WO2019090997A1 - Data acquisition method and device, computer device and storage medium - Google Patents

Data acquisition method and device, computer device and storage medium Download PDF

Info

Publication number
WO2019090997A1
WO2019090997A1 PCT/CN2018/075044 CN2018075044W WO2019090997A1 WO 2019090997 A1 WO2019090997 A1 WO 2019090997A1 CN 2018075044 W CN2018075044 W CN 2018075044W WO 2019090997 A1 WO2019090997 A1 WO 2019090997A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
acquired
receiving terminal
information
identification information
Prior art date
Application number
PCT/CN2018/075044
Other languages
French (fr)
Chinese (zh)
Inventor
骆水明
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019090997A1 publication Critical patent/WO2019090997A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0033Systems modifying transmission characteristics according to link quality, e.g. power backoff arrangements specific to the transmitter

Definitions

  • the present application relates to the field of communications technologies, and in particular, to a data acquisition method, apparatus, computer device, and storage medium.
  • the servers of the business system exchange a large amount of data with the terminal.
  • the terminal In the process of acquiring data by the existing terminal, the terminal directly sends a data acquisition request to the server, and then the server sends the corresponding data to the terminal according to the data acquisition request.
  • the server sends the corresponding data to the terminal according to the data acquisition request.
  • a large number of terminals acquire the same data from the server at the same time, for example, when the version of the business system is updated, a large number of terminals need to obtain an updated version of the installation package from the server, which is easy to cause the server to crash, and is also likely to cause network congestion. Reduce the efficiency of data acquisition.
  • the application provides a data acquisition method, device, computer device and storage medium to alleviate the access pressure of the server and improve the efficiency of data acquisition.
  • the application provides a data acquisition method, including:
  • the receiving terminal Determining whether the acknowledgment information fed back by the receiving terminal is received, wherein the acknowledgment information is that, after receiving the broadcast data packet, the receiving terminal searches for corresponding data to be acquired according to the identification information of the data to be acquired. Feedback information generated at the time;
  • the present application provides a data acquiring apparatus, including:
  • An identifier obtaining unit configured to acquire identification information of the data to be acquired if the data acquisition instruction is detected
  • a generating unit configured to generate a broadcast data packet according to the identifier information of the to-be-obtained data
  • a sending unit configured to send the broadcast data packet to at least one receiving terminal in the local area network
  • a determining unit configured to determine whether the acknowledgment information fed back by the receiving terminal is received, where the acknowledgment information is that the receiving terminal, after receiving the broadcast data packet, finds the identifier information according to the to-be-obtained data Corresponding feedback information generated when data is to be acquired;
  • the data obtaining unit is configured to obtain the acknowledgement information fed back by the receiving terminal, and acquire the to-be-obtained data according to the confirmation information.
  • the present application further provides a computer device comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein when the processor executes the program A data acquisition method according to any one of the preceding claims is implemented.
  • the present application also provides a storage medium, wherein the storage medium stores a computer program, the computer program comprising program instructions, the program instructions, when executed by a processor, causing the processor to execute the application The data acquisition method of any of the provided.
  • the application provides a data acquisition method, device, computer device and storage medium.
  • the method obtains data from the receiving terminal to reduce the access pressure of the server, and at the same time, the data is quickly acquired from the local area network, and the data acquisition efficiency can be improved.
  • FIG. 1 is a schematic flowchart of a data acquisition method according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of a specific process of step S102 in the data acquisition method shown in FIG. 1;
  • FIG. 3 is a schematic diagram of a scenario of a data acquisition method according to an embodiment of the present disclosure
  • step S105 is a schematic diagram of a specific process of step S105 in the data acquisition method shown in FIG. 1;
  • FIG. 5 is a schematic block diagram of a data acquiring apparatus according to an embodiment of the present application.
  • FIG. 6 is a schematic block diagram of a data acquiring apparatus according to an embodiment of the present application.
  • FIG. 7 is a schematic block diagram of a computer device according to an embodiment of the present application.
  • FIG. 1 is a schematic flowchart of a data acquisition method according to an embodiment of the present application.
  • the data acquisition method is applied to terminals such as desktop computers, laptop computers, tablet computers, and personal digital assistants (PDAs).
  • terminals such as desktop computers, laptop computers, tablet computers, and personal digital assistants (PDAs).
  • PDAs personal digital assistants
  • a plurality of terminals are included in a local area network.
  • the terminal that sends the data may be referred to as the transmitting terminal, and the terminal that receives the data is referred to as the receiving terminal.
  • the terminal that transmits a broadcast packet is referred to as a transmitting terminal
  • a terminal that receives a broadcast packet is referred to as a receiving terminal.
  • each terminal can serve as both a receiving terminal and a transmitting terminal in the entire local area network.
  • the data acquisition method includes steps S101 to S105.
  • the transmitting terminal will detect the data acquisition instruction, and acquire the identification information of the policy data according to the data acquisition instruction. It can be understood that the policy data is the data to be acquired.
  • the identification information of the data to be acquired may be an identifier that uniquely identifies the data to be acquired, such as a URL address and a file name, and is not specifically limited herein.
  • the broadcast data packet After obtaining the identification information of the data to be acquired, the broadcast data packet is generated according to the identification information.
  • the broadcast data packet carries the identification information of the data to be acquired.
  • FIG. 2 is a schematic diagram of a specific process of step S102 in the data acquisition method shown in FIG. Step S102 specifically includes steps S1021 to S1023.
  • Step S1021 Acquire an internet protocol address of all the receiving terminals in the local area network.
  • IP address Internet Protocol Address
  • the IP address of the sending terminal is also required to be acquired. This can facilitate communication between various terminals in the LAN.
  • Step S1022 Filter all the Internet Protocol addresses in the local area network to obtain an online Internet protocol address.
  • the online IP address may refer to an IP address that has been connected to the network. For example, if a computer in the LAN is connected to the LAN, the IP address of the computer is the online IP address.
  • the online IP address can be filtered out by a ping (Packet Internet Groper) command.
  • a ping Packet Internet Groper
  • the manner of filtering the online IP address is not limited to the ping command, and may be other modes, and no specific limitation is imposed herein.
  • Step S1023 Generate a broadcast data packet according to the identification information of the data to be acquired and the Internet protocol address of the online.
  • the broadcast data packet is generated according to the identification information of the data to be acquired, the online IP address, and the IP address of the transmitting terminal.
  • information such as a broadcast message header, identification information of the data to be acquired, an online IP address, and an IP address of the transmitting terminal may be generated according to a format of the broadcast data packet.
  • the operation of step S1022 may not be performed. That is, the generating the broadcast data packet according to the identifier information of the to-be-obtained data may include: acquiring an internet protocol address of all the receiving terminals in the local area network; and identifying information and all the information according to the to-be-obtained data.
  • the Internet Protocol address of the receiving terminal generates a broadcast data packet. In this way, when the broadcast data packet is subsequently sent, all the receiving terminals in the local area network receive the broadcast data packet.
  • FIG. 3 is a schematic diagram of a scenario of a data acquisition method according to an embodiment of the present application. After the transmitting terminal generates the broadcast data packet, the broadcast data packet is sent to the at least one receiving terminal through the local area network.
  • the sending terminal may specifically send the broadcast data packet through a UDP (User Data Protocol) protocol.
  • UDP User Data Protocol
  • the receiving terminal in the local area network searches locally for the corresponding data to be acquired according to the identification information of the data to be acquired in the broadcast data packet. If the receiving terminal determines that the data to be acquired is stored locally, the receiving terminal generates an acknowledgement message, and feeds the acknowledgement information to the sending terminal through the local area network to notify the sending terminal that the data to be acquired is stored.
  • S104 Determine whether the acknowledgment information fed back by the receiving terminal is received, where the acknowledgment information is that, after receiving the broadcast data packet, the receiving terminal searches for the corresponding to-be-acquired according to the identifier information of the data to be acquired. Feedback information generated when the data is obtained.
  • the transmitting terminal After the transmitting terminal sends the broadcast data packet, it will continuously monitor whether it receives the confirmation information fed back by the receiving terminal.
  • determining whether the acknowledgment information fed back by the receiving terminal is received specifically: determining whether the acknowledgment information fed back by the receiving terminal is received within a preset time. For example, determine if a confirmation message is received within 0.5 seconds. If the acknowledgment message has not been received for more than 0.5 seconds, the other receiving terminals in the local area network have no data to be acquired, and the sending terminal can be prevented from waiting for a long time.
  • the sending terminal may obtain the data to be acquired from the server. Specifically, as shown in FIG. 3, the transmitting terminal may send a data acquisition request to the server to acquire the to-be-obtained data from the server.
  • step S105 If the transmitting terminal receives the confirmation information fed back by the receiving terminal, the terminal performs step S105.
  • the confirmation information includes the identification information of the data to be acquired.
  • the acquiring the data to be acquired according to the confirmation information may be: acquiring the to-be-obtained data from the receiving terminal according to the confirmation information. That is to say, the transmitting terminal can obtain complete data to be acquired from the receiving terminal.
  • the confirmation information further includes an internet protocol address and a communication port number of the receiving terminal. Acquiring the to-be-obtained data from the receiving terminal according to the confirmation information, comprising: establishing a communication connection with the receiving terminal according to an internet protocol address of the receiving terminal; and receiving, by the receiving terminal, the sending terminal according to the communication port number The data to be acquired.
  • the communication port number can be a Socket port number.
  • the transmitting terminal can establish a TCP (Transmission Control Protocol) communication connection with the receiving terminal according to the IP address of the receiving terminal. Then, the corresponding communication port is found according to the Socket port number, and the data to be acquired is received through the communication port.
  • TCP Transmission Control Protocol
  • FIG. 4 is a schematic diagram of a specific process of step S105 in the data acquisition method shown in FIG.
  • the server may divide the data to be acquired into a plurality of data blocks for transmission. That is, the data to be acquired includes a plurality of data blocks. Due to network interruption and the like, the receiving terminal may only obtain a few data blocks, that is, only a part of the data to be acquired is stored in the receiving terminal. At this time, the confirmation information fed back by the receiving terminal will include the identification information of the stored data block in the receiving terminal and the identification information of the unstored data block.
  • the identifier information of the stored data block and the identifier information of the unstored data block may be identifiers configured by the server for each data block. For example, if the data to be acquired includes 4 data blocks, the server may configure identification information for each of the 4 data blocks as a, b, c, and d. The server transmits the identification information of the four data blocks to the receiving terminal, and simultaneously transmits the data block to the receiving terminal. It is assumed that after the receiving terminal receives the a data block and the b data block, the network of the receiving terminal fails, so that the receiving terminal cannot acquire the c data block and the d data block from the server. Therefore, the confirmation information fed back by the receiving terminal carries the identification information a and b of the stored data block, and the identification information c and d of the unstored data block.
  • the obtaining the data to be acquired according to the confirmation information may specifically include steps S1051 to S1052.
  • S1051 Acquire a corresponding data block from the receiving terminal according to the identifier information of the stored data block.
  • the transmitting terminal establishes a communication connection with the receiving terminal according to the confirmation information, and acquires a corresponding data block from the receiving terminal according to the identification information of the stored data block.
  • the confirmation information includes an IP address of the receiving terminal, establishes a TCP communication connection with the receiving terminal according to the IP address of the receiving terminal, and then acquires a data block and b data block of the data to be acquired from the receiving terminal.
  • S1052 Acquire a corresponding data block from the server according to the identifier information of the unstored data block to complete acquiring the to-be-obtained data.
  • the transmitting terminal generates a data acquisition request according to the identification information of the data to be acquired and the identification information of the unstored data block, and sends the data acquisition request to the server to obtain the unstored data block from the server.
  • the identification information corresponds to the data block.
  • the c data block and the d data block of the data to be acquired are obtained from the server.
  • the data to be acquired is stored in the local storage.
  • the local hard drive is medium. In this way, when other terminals in the local area network need the data to be acquired, data can be acquired from the sending terminal.
  • the open source component DiskCache.NET can be used to create a hard disk space as a cache to store data to be acquired.
  • the data to be acquired may be encrypted by the DiskCache.NET component.
  • the method further includes: monitoring whether a network status between the receiving terminal and the receiving terminal is in a busy state; and if a network status between the receiving terminal and the receiving terminal When it is busy, it continues to acquire data from other receiving terminals in the local area network.
  • the busy state may be a state when the network signal strength between the transmitting terminal and the receiving terminal is lower than a threshold, that is, a network signal difference.
  • a threshold that is, a network signal difference.
  • the busy state can also be other states, and no specific restrictions are imposed here.
  • the transmitting terminal When the transmitting terminal detects that the network state between the receiving terminal and the receiving terminal is busy, it can continue to receive data to other receiving terminals in the local area network. For example, when a plurality of pieces of confirmation information are received in step S105, one piece of confirmation information may be selected among other confirmation information, and the data may be continuously acquired from the corresponding receiving terminal according to the confirmation information.
  • the data can also be continuously obtained from the server.
  • the data acquisition method in an embodiment may be embedded in various application systems in the form of a plug-in, for example, embedded in a life insurance system application in the form of a plug-in.
  • the data acquisition method can also be embedded into the Windows service based on the service deployment technology of .NET and packaged into a Windows service.
  • the terminal can use the data acquisition method by deploying the Windows service.
  • the data obtaining method in the embodiment obtains the identification information of the data to be acquired when the data acquisition instruction is detected; generates the broadcast data packet according to the identification information of the data to be acquired, and sends the broadcast data packet to at least one receiving terminal in the local area network. After receiving the confirmation information fed back by the receiving terminal, the data to be acquired is obtained according to the confirmation information.
  • the method can reasonably utilize the resources of the server and the local area network, and obtain the data from the receiving terminal when the receiving terminal in the local area network stores the data to be acquired, so as to alleviate the access pressure caused by directly acquiring data from the server, and obtain the access pressure from the local area network.
  • the speed of the data is relatively fast, which can improve the efficiency of data acquisition.
  • the access pressure of the server is greatly alleviated, the efficiency of the terminal to obtain data from the server in the local area network can be further improved.
  • FIG. 5 is a schematic block diagram of a data acquiring apparatus according to an embodiment of the present application.
  • the data acquisition device 300 can be installed in a terminal such as a desktop computer, a tablet computer, a laptop computer, a personal digital assistant (PAD), or a tablet computer.
  • a terminal such as a desktop computer, a tablet computer, a laptop computer, a personal digital assistant (PAD), or a tablet computer.
  • PAD personal digital assistant
  • a plurality of terminals are included in a local area network.
  • the terminal that sends the data may be referred to as the transmitting terminal, and the terminal that receives the data is referred to as the receiving terminal.
  • the data acquisition device 300 includes an identification acquisition unit 301, a generation unit 302, a transmission unit 303, a determination unit 304, and a data acquisition unit 305.
  • the identifier obtaining unit 301 is configured to obtain identification information of the data to be acquired if the data acquisition instruction is detected.
  • the identifier obtaining unit 301 can detect the data acquisition instruction, and acquire the identification information of the data to be acquired according to the data acquisition instruction.
  • the identifier information of the to-be-obtained data may be an identifier that uniquely identifies the data to be acquired, such as a URL address and a file name, and is not specifically limited herein.
  • the generating unit 302 is configured to generate a broadcast data packet according to the identifier information of the data to be acquired.
  • the generating unit 302 After the identifier obtaining unit 301 acquires the identifier information of the data to be acquired, the generating unit 302 generates a broadcast data packet according to the identifier information.
  • the broadcast data packet carries the identification information of the data to be acquired.
  • FIG. 6 is another schematic block diagram of a data acquiring apparatus according to an embodiment of the present application.
  • the generating unit 302 includes an obtaining subunit 3021, a screening subunit 3022, and a generating subunit 3023.
  • the obtaining subunit 3021 is configured to acquire an internet protocol address of all the receiving terminals in the local area network.
  • the obtaining sub-unit 3021 needs to acquire the IP address of the sending terminal when acquiring the Internet Protocol Address (IP address) of all the receiving terminals in the local area network. This can facilitate communication between various terminals in the LAN.
  • IP address Internet Protocol Address
  • the screening sub-unit 3022 is configured to filter all the Internet Protocol addresses in the local area network to obtain an online Internet Protocol address.
  • the online internet protocol address may refer to an internet protocol address that has been connected to the network.
  • the screening sub-unit 3022 can filter out the online IP address by a ping (Packet Internet Groper) command.
  • ping Packet Internet Groper
  • the filtering sub-unit 3022 may also filter the online IP address in other manners, and no specific limitation is imposed herein.
  • the online filtering of all the IP addresses obtained by the obtaining sub-unit 3021 is performed by the filtering sub-unit 3022, so that the broadcast data packets can be more specifically transmitted to the receiving terminals of the online, so that the network resources in the local area network can be reasonably utilized to avoid the local area network. Congestion has occurred.
  • the generating subunit 3023 is configured to generate a broadcast data packet according to the identification information of the data to be acquired and the Internet protocol address of the online.
  • the generating subunit 3023 generates a broadcast data packet according to the identification information of the data to be acquired, the online IP address, and the IP address of the transmitting terminal.
  • the generating unit 302 may also not include the filtering sub-unit 3022. That is, after the obtaining sub-unit 3021 acquires the Internet Protocol addresses of all the receiving terminals in the local area network, the generating sub-unit 3023 generates the identifier information according to the to-be-obtained data and the Internet Protocol addresses of all the receiving terminals. Broadcast packet. In this way, when the broadcast data packet is subsequently sent, all the receiving terminals in the local area network receive the broadcast data packet.
  • the sending unit 303 is configured to send the broadcast data packet to at least one receiving terminal in the local area network.
  • the sending unit 303 may specifically send the broadcast data packet by using a UDP (User Data Protocol) protocol.
  • UDP User Data Protocol
  • the receiving terminal in the local area network searches locally for the corresponding data to be acquired according to the identification information of the data to be acquired in the broadcast data packet. If the receiving terminal determines that the data to be acquired is stored locally, the receiving terminal generates an acknowledgement message, and feeds the acknowledgement information to the sending terminal through the local area network to notify the sending terminal that the data to be acquired is stored.
  • the determining unit 304 is configured to determine whether the acknowledgment information fed back by the receiving terminal is received, where the acknowledgment information is that, after receiving the broadcast data packet, the receiving terminal searches for the identifier information of the data to be acquired. Feedback information generated when the corresponding data to be acquired is obtained.
  • the determining unit 304 will continuously monitor whether or not the acknowledgement information fed back by the receiving terminal is received.
  • the determining unit 304 is specifically configured to determine whether the confirmation information fed back by the receiving terminal is received within a preset time. If the confirmation message has not been received before the preset time, the other receiving terminals in the local area network have no data to be acquired, and the sending terminal can be prevented from waiting for a long time.
  • the determining unit 304 If the determining unit 304 does not receive the confirmation information fed back by the receiving terminal, the determining unit 304 transmits the first signal to the data acquiring unit 305. If the determining unit 304 receives the confirmation information fed back by the receiving terminal, the determining unit 304 transmits a second signal to the data acquiring unit 305.
  • the data obtaining unit 305 is configured to obtain the acknowledgement information fed back by the receiving terminal, and acquire the to-be-obtained data according to the confirmation information.
  • the data acquisition unit 305 when the data acquisition unit 305 receives the first signal sent by the determining unit 304, it indicates that there is no data to be acquired in other terminals in the local area network, and the data acquiring unit 305 can obtain the data to be acquired from the server. Specifically, the data acquisition unit 305 transmits a data acquisition request to the server to acquire the data to be acquired from the server.
  • the data acquisition unit 305 when the data acquisition unit 305 receives the second signal sent by the determining unit 304, it indicates that the data to be acquired is stored in other terminals in the local area network, and the data acquiring unit 305 can obtain the to-be-acquired according to the confirmation information. data.
  • the confirmation information includes the identification information of the data to be acquired.
  • the data obtaining unit 305 is specifically configured to acquire the to-be-obtained data from the receiving terminal according to the confirmation information. That is to say, the data acquisition unit 305 can acquire complete data to be acquired from the receiving terminal.
  • the confirmation information further includes an internet protocol address and a communication port number of the receiving terminal.
  • the data obtaining unit 305 establishes a communication connection with the receiving terminal according to the Internet Protocol address of the receiving terminal, and receives the to-be-obtained data sent by the receiving terminal according to the communication port number.
  • the communication port number can be a Socket port number.
  • the data acquisition unit 305 can establish a TCP (Transmission Control Protocol) communication connection with the receiving terminal according to the IP address of the receiving terminal, and then find a corresponding communication port according to the Socket port number, and receive the data to be acquired through the communication port.
  • TCP Transmission Control Protocol
  • the server may divide the data to be acquired into a plurality of data blocks for transmission. That is, the data to be acquired includes a plurality of data blocks. Due to network interruption and the like, the receiving terminal may only obtain a few data blocks, that is, only a part of the data to be acquired is stored in the receiving terminal.
  • the confirmation information fed back by the receiving terminal will include the identification information of the stored data block in the receiving terminal and the identification information of the unstored data block.
  • the identifier information of the stored data block and the identifier information of the unstored data block may be identifiers configured by the server for each data block.
  • the data obtaining unit 305 is specifically configured to acquire, according to the identification information of the stored data block, the corresponding terminal from the receiving terminal. And obtaining a corresponding data block from the server according to the identification information of the unstored data block to complete acquiring the to-be-obtained data.
  • the data obtaining unit 305 establishes a communication connection with the receiving terminal according to the confirmation information, and acquires a corresponding data block from the receiving terminal according to the identification information of the stored data block.
  • the data obtaining unit 305 further generates a data acquisition request according to the identification information of the data to be acquired and the identification information of the unstored data block, and sends the data acquisition request to the server to acquire data corresponding to the identification information of the unstored data block from the server.
  • Piece the data acquisition request according to the identification information of the data to be acquired and the identification information of the unstored data block
  • the data acquisition device 300 further includes a storage unit 306.
  • the storage unit 306 stores the data to be acquired in the local storage.
  • the local hard drive is medium. In this way, when other terminals in the local area network need the data to be acquired, data can be acquired from the sending terminal.
  • the storage unit 306 can open up a hard disk space as a cache through the open source component DiskCache.NET to store data to be acquired.
  • the data to be acquired may be encrypted by the DiskCache.NET component.
  • the data acquisition device 300 further includes a monitoring unit.
  • the monitoring unit is configured to monitor whether a network status with the receiving terminal is in a busy state. When the monitoring unit detects that the network status between the receiving terminal and the receiving terminal is in a busy state, sending a third signal to the data acquiring unit 305, so that the data acquiring unit 305 continues to acquire data according to the third signal to other receiving terminals in the local area network. .
  • the data acquisition unit 305 may select one of the other confirmation information, and continue to acquire data from the corresponding receiving terminal according to the confirmation information.
  • the monitoring unit may also send a fourth signal to the data acquiring unit 305, so that the data acquiring unit 305 continues to acquire data from the server according to the fourth signal.
  • the data obtaining apparatus 300 in this embodiment acquires data from the receiving terminal in the case where the receiving terminal in the local area network stores the data to be acquired, so as to reduce the access pressure of the server, and at the same time, the data is quickly acquired from the local area network. Can improve the efficiency of data acquisition.
  • the above data acquisition means can be implemented in the form of a computer program which can be run on a computer device as shown in FIG.
  • FIG. 7 is a schematic block diagram of a computer device according to an embodiment of the present application.
  • the computer device 400 device can be a terminal.
  • the terminal can be an electronic device such as a tablet computer, a notebook computer, a desktop computer, or a personal digital assistant.
  • the computer device 400 includes a processor 402, a memory, and a network interface 405 connected by a system bus 401, wherein the memory can include a non-volatile storage medium 403 and an internal memory 404.
  • the non-volatile storage medium 403 can store an operating system 4031 and a computer program 4032.
  • the computer program 4032 includes program instructions that, when executed, cause the processor 402 to perform a data acquisition method.
  • the processor 402 is used to provide computing and control capabilities to support the operation of the entire computer device 400.
  • the internal memory 404 provides an environment for the operation of the computer program 4032 in the non-volatile storage medium 403, which when executed by the processor 402, causes the processor 402 to perform a data acquisition method.
  • the network interface 405 is used for network communication, such as sending assigned tasks and the like. It will be understood by those skilled in the art that the structure shown in FIG. 7 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation of the computer device 400 to which the solution of the present application is applied, and a specific computer device. 400 may include more or fewer components than shown in the figures, or some components may be combined, or have different component arrangements.
  • the processor 402 is configured to run the computer program 4032 stored in the memory to implement the following functions: if the data acquisition instruction is detected, the identification information of the data to be acquired is acquired; and the broadcast is generated according to the identification information of the data to be acquired. Transmitting the broadcast data packet to at least one receiving terminal in the local area network; determining whether the acknowledgment information fed back by the receiving terminal is received, wherein the acknowledgment information is that the receiving terminal after receiving the broadcast data packet And obtaining, according to the identifier information of the to-be-obtained data, the feedback information generated when the corresponding data to be acquired is obtained; and if the confirmation information fed back by the receiving terminal is received, the data to be acquired is obtained according to the confirmation information.
  • the data to be acquired includes a plurality of data blocks;
  • the confirmation information includes identification information of the stored data block in the receiving terminal and identification information of the unstored data block;
  • the processor 402 is performing the When the data to be acquired is obtained according to the confirmation information, the following procedure is specifically executed: acquiring a corresponding data block from the receiving terminal according to the identification information of the stored data block; and identifying information according to the unstored data block Obtaining a corresponding data block from the server to complete acquiring the to-be-obtained data.
  • the processor 402 when performing the acquiring the to-be-obtained data according to the confirmation information, specifically executes a process of: acquiring the to-be-obtained data from the receiving terminal according to the confirmation information.
  • the processor 402 when the processor 402 is configured to generate a broadcast data packet according to the identifier information of the data to be acquired, the following is specifically performed: acquiring an internet protocol address of all the receiving terminals in the local area network; All the Internet Protocol addresses are filtered to obtain an online Internet Protocol address; the broadcast data packet is generated according to the identification information of the data to be acquired and the online Internet Protocol address.
  • the confirmation information further includes an internet protocol address and a communication port number of the receiving terminal; and the processor 402 performs specific execution when acquiring the to-be-obtained data from the receiving terminal according to the confirmation information.
  • the processor 402 may be a central processing unit, and the processor 402 may also be other general purpose processors, digital signal processors, application specific integrated circuits, off-the-shelf programmable gate arrays or other programmable logic devices, and discrete Gate or transistor logic, discrete hardware components, etc.
  • the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • a storage medium in another embodiment of the present application, can be a computer readable storage medium.
  • the storage medium stores a computer program, wherein the computer program includes program instructions.
  • the program instruction is executed by the processor, if the data acquisition instruction is detected, the identification information of the data to be acquired is acquired; the broadcast data packet is generated according to the identification information of the data to be acquired; and the broadcast is sent to at least one receiving terminal in the local area network.
  • the acknowledgment information is that the receiving terminal searches for the corresponding information according to the identification information of the data to be acquired after receiving the broadcast data packet
  • the data to be acquired includes a plurality of data blocks;
  • the confirmation information includes identification information of the stored data block in the receiving terminal and identification information of the unstored data block;
  • the program instruction is executed by the processor
  • the method further: obtaining, according to the identifier information of the stored data block, a corresponding data block from the receiving terminal; and determining, according to the identifier information of the unstored data block Obtaining a corresponding data block from the server to complete acquiring the to-be-obtained data.
  • the specific implementation is: acquiring the to-be-obtained data from the receiving terminal according to the confirmation information.
  • the specific implementation is: acquiring an internet protocol address of all the receiving terminals in the local area network; All the Internet Protocol addresses are filtered to obtain an online Internet Protocol address; the broadcast data packet is generated according to the identification information of the data to be acquired and the online Internet Protocol address.
  • the confirmation information further includes an internet protocol address and a communication port number of the receiving terminal; and the program instruction is executed by the processor, when acquiring the to-be-obtained data from the receiving terminal according to the confirmation information,
  • the specific implementation is: establishing a communication connection with the receiving terminal according to the Internet Protocol address of the receiving terminal; and receiving the to-be-obtained data sent by the receiving terminal according to the communication port number.
  • the storage medium may be a medium that can store program codes, such as a USB flash drive, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk.
  • program codes such as a USB flash drive, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk.
  • each unit is only a logical function division, and there may be another division manner in actual implementation.
  • the steps in the method of the embodiment of the present application may be sequentially adjusted, merged, and deleted according to actual needs.
  • the units in the data obtaining apparatus of the embodiment of the present application may be combined, divided, and deleted according to actual needs.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit can be stored in a storage medium if it is implemented in the form of a software functional unit and sold or used as a standalone product. Based on such understanding, the technical solution of the present application may be in essence or part of the contribution to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium. There are a number of instructions for causing a computer device (which may be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application.
  • a computer device which may be a personal computer, terminal, or network device, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Small-Scale Networks (AREA)

Abstract

Disclosed in the embodiments of the present application are a data acquisition method and device, a computer device and a storage medium. The method comprises: when a data acquisition instruction is detected, acquiring identification information of data to be acquired; generating, according to the identification information of the data to be acquired, a broadcast data packet, and sending the broadcast data packet to at least one receiving terminal in a local area network; and after acknowledgement information fed back by the receiving terminal is received, acquiring the data to be acquired according to the acknowledgement information.

Description

一种数据获取方法、装置、计算机设备及存储介质Data acquisition method, device, computer equipment and storage medium
本申请要求于2017年11月13日提交中国专利局、申请号为201711113536.4、发明名称为“一种数据获取方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application filed on November 13, 2017, the Chinese Patent Office, Application No. 201711113536.4, entitled "A Data Acquisition Method, Apparatus, Computer Equipment, and Storage Medium", the entire contents of which are hereby incorporated by reference. The citations are incorporated herein by reference.
技术领域Technical field
本申请涉及通信技术领域,尤其涉及一种数据获取方法、装置、计算机设备及存储介质。The present application relates to the field of communications technologies, and in particular, to a data acquisition method, apparatus, computer device, and storage medium.
背景技术Background technique
随着计算机设备及网络技术的不断发展,很多资源都会存储在服务器中。尤其是企业的一些业务系统的服务器,业务系统的服务器会与终端进行大量的数据交互。在现有的终端获取数据的过程中,终端会直接向服务器发送数据获取请求,然后服务器根据数据获取请求将对应的数据发送至终端。然而,当大量终端同时向服务器获取同一数据时,比如,业务系统的版本发生更新时,大量终端需要向服务器获取更新版本的安装包,这样就很容易造成服务器崩溃,同时也容易造成网络拥堵,降低数据获取的效率。With the continuous development of computer equipment and network technology, many resources are stored in the server. Especially for the servers of some business systems of the enterprise, the servers of the business system exchange a large amount of data with the terminal. In the process of acquiring data by the existing terminal, the terminal directly sends a data acquisition request to the server, and then the server sends the corresponding data to the terminal according to the data acquisition request. However, when a large number of terminals acquire the same data from the server at the same time, for example, when the version of the business system is updated, a large number of terminals need to obtain an updated version of the installation package from the server, which is easy to cause the server to crash, and is also likely to cause network congestion. Reduce the efficiency of data acquisition.
发明内容Summary of the invention
本申请提供了一种数据获取方法、装置、计算机设备及存储介质,以缓解服务器的访问压力,提高数据获取的效率。The application provides a data acquisition method, device, computer device and storage medium to alleviate the access pressure of the server and improve the efficiency of data acquisition.
第一方面,本申请提供了一种数据获取方法,其包括:In a first aspect, the application provides a data acquisition method, including:
若检测到数据获取指令,获取待获取数据的标识信息;If the data acquisition instruction is detected, obtaining identification information of the data to be acquired;
根据所述待获取数据的标识信息生成广播数据包;Generating a broadcast data packet according to the identification information of the data to be acquired;
向局域网内至少一个接收终端发送所述广播数据包;Transmitting the broadcast data packet to at least one receiving terminal in the local area network;
判断是否接收到所述接收终端反馈的确认信息,其中,所述确认信息为所述接收终端在接收到所述广播数据包后,根据所述待获取数据的标识信息查找 到对应的待获取数据时生成的反馈信息;Determining whether the acknowledgment information fed back by the receiving terminal is received, wherein the acknowledgment information is that, after receiving the broadcast data packet, the receiving terminal searches for corresponding data to be acquired according to the identification information of the data to be acquired. Feedback information generated at the time;
若接收到所述接收终端反馈的确认信息,根据所述确认信息获取所述待获取数据。And receiving the confirmation information fed back by the receiving terminal, and acquiring the to-be-obtained data according to the confirmation information.
第二方面,本申请提供了一种数据获取装置,其包括:In a second aspect, the present application provides a data acquiring apparatus, including:
标识获取单元,用于若检测到数据获取指令,获取待获取数据的标识信息;An identifier obtaining unit, configured to acquire identification information of the data to be acquired if the data acquisition instruction is detected;
生成单元,用于根据所述待获取数据的标识信息生成广播数据包;a generating unit, configured to generate a broadcast data packet according to the identifier information of the to-be-obtained data;
发送单元,用于向局域网内至少一个接收终端发送所述广播数据包;a sending unit, configured to send the broadcast data packet to at least one receiving terminal in the local area network;
判断单元,用于判断是否接收到所述接收终端反馈的确认信息,其中,所述确认信息为所述接收终端在接收到所述广播数据包后,根据所述待获取数据的标识信息查找到对应的待获取数据时生成的反馈信息;a determining unit, configured to determine whether the acknowledgment information fed back by the receiving terminal is received, where the acknowledgment information is that the receiving terminal, after receiving the broadcast data packet, finds the identifier information according to the to-be-obtained data Corresponding feedback information generated when data is to be acquired;
数据获取单元,用于若接收到所述接收终端反馈的确认信息,根据所述确认信息获取所述待获取数据。The data obtaining unit is configured to obtain the acknowledgement information fed back by the receiving terminal, and acquire the to-be-obtained data according to the confirmation information.
第三方面,本申请又提供了一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其中,所述处理器执行所述程序时实现本申请提供的任一项所述的数据获取方法。In a third aspect, the present application further provides a computer device comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein when the processor executes the program A data acquisition method according to any one of the preceding claims is implemented.
第四方面,本申请还提供了一种存储介质,其中所述存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行本申请提供的任一项所述的数据获取方法。In a fourth aspect, the present application also provides a storage medium, wherein the storage medium stores a computer program, the computer program comprising program instructions, the program instructions, when executed by a processor, causing the processor to execute the application The data acquisition method of any of the provided.
本申请提供一种数据获取方法、装置、计算机设备及存储介质。该方法在局域网内的接收终端中存储有待获取数据的情况下,从接收终端获取数据,以减轻服务器的访问压力,同时,从局域网内获取数据的速度较快,可以提高数据获取的效率。The application provides a data acquisition method, device, computer device and storage medium. In the case that the data is to be acquired in the receiving terminal in the local area network, the method obtains data from the receiving terminal to reduce the access pressure of the server, and at the same time, the data is quickly acquired from the local area network, and the data acquisition efficiency can be improved.
附图说明DRAWINGS
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings used in the description of the embodiments will be briefly described below. Obviously, the drawings in the following description are some embodiments of the present application, For the ordinary technicians, other drawings can be obtained based on these drawings without any creative work.
图1为本申请一实施例提供的一种数据获取方法的示意流程图;FIG. 1 is a schematic flowchart of a data acquisition method according to an embodiment of the present application;
图2为图1所示数据获取方法中步骤S102的具体流程示意图;2 is a schematic diagram of a specific process of step S102 in the data acquisition method shown in FIG. 1;
图3为本申请一实施例提供的一种数据获取方法的场景示意图;FIG. 3 is a schematic diagram of a scenario of a data acquisition method according to an embodiment of the present disclosure;
图4为图1所示数据获取方法中步骤S105的具体流程示意图;4 is a schematic diagram of a specific process of step S105 in the data acquisition method shown in FIG. 1;
图5为本申请一实施例提供的一种数据获取装置的一示意性框图;FIG. 5 is a schematic block diagram of a data acquiring apparatus according to an embodiment of the present application;
图6为本申请一实施例提供的一种数据获取装置的一示意性框图;FIG. 6 is a schematic block diagram of a data acquiring apparatus according to an embodiment of the present application;
图7为本申请一实施例提供的一种计算机设备的一示意性框图。FIG. 7 is a schematic block diagram of a computer device according to an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the drawings in the embodiments of the present application. It is obvious that the described embodiments are a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
请参阅图1,图1是本申请实施例提供的一种数据获取方法的示意流程图。该数据获取方法应用于台式电脑、手提电脑、平板电脑、个人数字助理(PDA)等终端中。Please refer to FIG. 1. FIG. 1 is a schematic flowchart of a data acquisition method according to an embodiment of the present application. The data acquisition method is applied to terminals such as desktop computers, laptop computers, tablet computers, and personal digital assistants (PDAs).
一般来说,局域网内包括多个终端。为了方便区分各个终端,在某一次数据交互过程中,可以将发送数据的终端称为发送终端,将接收数据的终端称为接收终端。譬如,将发送广播数据包的终端称为发送终端,将接收广播数据包的终端称为接收终端。可以理解的是,在整个局域网内,每个终端既可以作为接收终端,也可以作为发送终端。Generally, a plurality of terminals are included in a local area network. In order to facilitate the differentiation of the terminals, the terminal that sends the data may be referred to as the transmitting terminal, and the terminal that receives the data is referred to as the receiving terminal. For example, a terminal that transmits a broadcast packet is referred to as a transmitting terminal, and a terminal that receives a broadcast packet is referred to as a receiving terminal. It can be understood that each terminal can serve as both a receiving terminal and a transmitting terminal in the entire local area network.
以下将以发送终端的角度描述本实施例中数据获取方法的具体过程。如图1所示,该数据获取方法包括步骤S101~S105。The specific process of the data acquisition method in this embodiment will be described below from the perspective of the transmitting terminal. As shown in FIG. 1, the data acquisition method includes steps S101 to S105.
S101、若检测到数据获取指令,获取待获取数据的标识信息。S101. If a data acquisition instruction is detected, obtain identifier information of the data to be acquired.
譬如,当用户点开发送终端中人寿保险系统应用的操作界面时,若用户希望获取某一保单数据,用户点击该保单数据的URL(Uniform Resoure Locator,统一资源定位器)地址。此时,发送终端将会检测到数据获取指令,并根据该数据获取指令获取该保单数据的标识信息。可以理解的是,该保单数据即为待获取数据。For example, when the user clicks on the operation interface of the life insurance system application in the sending terminal, if the user wants to obtain a certain policy data, the user clicks the URL (Uniform Resoure Locator) address of the policy data. At this time, the transmitting terminal will detect the data acquisition instruction, and acquire the identification information of the policy data according to the data acquisition instruction. It can be understood that the policy data is the data to be acquired.
在一实施例中,该待获取数据的标识信息可以为URL地址、文件名称等唯一识别出该待获取数据的标识,在此不做具体限制。In an embodiment, the identification information of the data to be acquired may be an identifier that uniquely identifies the data to be acquired, such as a URL address and a file name, and is not specifically limited herein.
S102、根据所述待获取数据的标识信息生成广播数据包。S102. Generate a broadcast data packet according to the identifier information of the to-be-obtained data.
在获取到待获取数据的标识信息后,将根据标识信息生成广播数据包。其中,该广播数据包将携带有待获取数据的标识信息。After obtaining the identification information of the data to be acquired, the broadcast data packet is generated according to the identification information. The broadcast data packet carries the identification information of the data to be acquired.
在一实施例中,请参阅图2,图2为图1所示数据获取方法中步骤S102的具体流程示意图。步骤S102具体包括步骤S1021~步骤S1023。In an embodiment, please refer to FIG. 2. FIG. 2 is a schematic diagram of a specific process of step S102 in the data acquisition method shown in FIG. Step S102 specifically includes steps S1021 to S1023.
步骤S1021、获取所述局域网内所有所述接收终端的互联网协议地址。Step S1021: Acquire an internet protocol address of all the receiving terminals in the local area network.
在一实施例中,在获取局域网内的所有接收终端的互联网协议地址(Internet Protocol Address,简称IP地址)时,也需要获取发送终端的IP地址。这样可以方便局域网内各个终端进行通信。In an embodiment, when obtaining an Internet Protocol Address (IP address) of all the receiving terminals in the local area network, the IP address of the sending terminal is also required to be acquired. This can facilitate communication between various terminals in the LAN.
步骤S1022、对所述局域网内所有所述互联网协议地址进行筛选以获得在线的互联网协议地址。Step S1022: Filter all the Internet Protocol addresses in the local area network to obtain an online Internet protocol address.
为了避免发送广播数据包占用局域网过多的资源,造成局域网内拥堵,因此,在获取到局域网内所有接收终端的IP地址之后,需要对获取到的所有IP地址进行在线筛选,以筛选出在线的IP地址。这样可以使得广播数据包更有针对性地发送到各个在线的接收终端中,使得局域网内网络资源得到合理利用,避免局域网发生拥堵。In order to prevent the transmission of broadcast data packets from occupying too many resources on the local area network, congestion in the local area network is caused. Therefore, after obtaining the IP addresses of all receiving terminals in the local area network, all the obtained IP addresses need to be screened online to filter out the online IP address. In this way, the broadcast data packet can be more specifically transmitted to each online receiving terminal, so that the network resources in the local area network can be reasonably utilized to avoid congestion of the local area network.
在一实施例中,在线的IP地址可以指已经连接上网络的IP地址。譬如,局域网内某台电脑已经连接到局域网中,那么该台电脑的IP地址就是在线的IP地址。In an embodiment, the online IP address may refer to an IP address that has been connected to the network. For example, if a computer in the LAN is connected to the LAN, the IP address of the computer is the online IP address.
具体地,在一实施例中,可以通过ping(Packet Internet Groper,因特网包探索器)命令过滤出在线的IP地址。需要说明的是,过滤在线的IP地址的方式不局限于ping命令,还可以为其他方式,在此不做具体限制。Specifically, in an embodiment, the online IP address can be filtered out by a ping (Packet Internet Groper) command. It should be noted that the manner of filtering the online IP address is not limited to the ping command, and may be other modes, and no specific limitation is imposed herein.
步骤S1023、根据所述待获取数据的标识信息和在线的互联网协议地址生成广播数据包。Step S1023: Generate a broadcast data packet according to the identification information of the data to be acquired and the Internet protocol address of the online.
在一实施例中,在获取到在线的IP地址和发送终端的IP地址后,将根据待获取数据的标识信息、在线的IP地址和发送终端的IP地址生成广播数据包。具体地,在一实施例中,可以将广播报文报头、待获取数据的标识信息、在线的IP地址和发送终端的IP地址等信息按照广播数据包的格式生成广播数据包。In an embodiment, after obtaining the online IP address and the IP address of the transmitting terminal, the broadcast data packet is generated according to the identification information of the data to be acquired, the online IP address, and the IP address of the transmitting terminal. Specifically, in an embodiment, information such as a broadcast message header, identification information of the data to be acquired, an online IP address, and an IP address of the transmitting terminal may be generated according to a format of the broadcast data packet.
当然,在其他实施例中,也可以不进行步骤S1022的操作。也就是说,根据所述待获取数据的标识信息生成广播数据包,具体可以包括:获取所述局域网内所有所述接收终端的互联网协议地址;以及根据所述待获取数据的标识信 息和所有所述接收终端的互联网协议地址生成广播数据包。这样,在后续发送广播数据包时,局域网内所有接收终端都会接收到该广播数据包。Of course, in other embodiments, the operation of step S1022 may not be performed. That is, the generating the broadcast data packet according to the identifier information of the to-be-obtained data may include: acquiring an internet protocol address of all the receiving terminals in the local area network; and identifying information and all the information according to the to-be-obtained data. The Internet Protocol address of the receiving terminal generates a broadcast data packet. In this way, when the broadcast data packet is subsequently sent, all the receiving terminals in the local area network receive the broadcast data packet.
S103、向局域网内至少一个接收终端发送所述广播数据包。S103. Send the broadcast data packet to at least one receiving terminal in the local area network.
在一实施例中,如图3所示,图3为本申请一实施例中数据获取方法的场景示意图。在发送终端生成广播数据包后,将通过局域网向至少一个接收终端发送广播数据包。In an embodiment, as shown in FIG. 3, FIG. 3 is a schematic diagram of a scenario of a data acquisition method according to an embodiment of the present application. After the transmitting terminal generates the broadcast data packet, the broadcast data packet is sent to the at least one receiving terminal through the local area network.
在一实施例中,发送终端具体可以通过UDP(User Data Protocol,用户数据报协议)协议发送该广播数据包。In an embodiment, the sending terminal may specifically send the broadcast data packet through a UDP (User Data Protocol) protocol.
在本实施例中,局域网内的接收终端在接收到广播数据包后,将根据该广播数据包中的待获取数据的标识信息在本地查找是否存在对应的待获取数据。若接收终端判断出本地存储有该待获取数据,那么接收终端会生成一个确认信息,并将该确认信息通过局域网反馈给发送终端,以告知发送终端其存储有待获取数据。In this embodiment, after receiving the broadcast data packet, the receiving terminal in the local area network searches locally for the corresponding data to be acquired according to the identification information of the data to be acquired in the broadcast data packet. If the receiving terminal determines that the data to be acquired is stored locally, the receiving terminal generates an acknowledgement message, and feeds the acknowledgement information to the sending terminal through the local area network to notify the sending terminal that the data to be acquired is stored.
S104、判断是否接收到所述接收终端反馈的确认信息,其中,所述确认信息为所述接收终端在接收到所述广播数据包后,根据所述待获取数据的标识信息查找到对应的待获取数据时生成的反馈信息。S104. Determine whether the acknowledgment information fed back by the receiving terminal is received, where the acknowledgment information is that, after receiving the broadcast data packet, the receiving terminal searches for the corresponding to-be-acquired according to the identifier information of the data to be acquired. Feedback information generated when the data is obtained.
发送终端发送完广播数据包后,将不断地监听是否接收到接收终端反馈的确认信息。After the transmitting terminal sends the broadcast data packet, it will continuously monitor whether it receives the confirmation information fed back by the receiving terminal.
在一实施例中,判断是否接收到所述接收终端反馈的确认信息,具体包括:判断预设时间内是否接收到所述接收终端反馈的确认信息。譬如,判断0.5秒内是否接收到确认信息。如果超过0.5秒还没有接收到确认信息,那就默认局域网内其他接收终端没有待获取数据,可以避免发送终端长时间处于等待状态。In an embodiment, determining whether the acknowledgment information fed back by the receiving terminal is received, specifically: determining whether the acknowledgment information fed back by the receiving terminal is received within a preset time. For example, determine if a confirmation message is received within 0.5 seconds. If the acknowledgment message has not been received for more than 0.5 seconds, the other receiving terminals in the local area network have no data to be acquired, and the sending terminal can be prevented from waiting for a long time.
若发送终端未接收到接收终端反馈的确认信息,说明局域网内其他终端中未存储该待获取数据,此时发送终端可以向服务器获取待获取数据。具体地,如图3所示,发送终端可以向所述服务器发送数据获取请求以从所述服务器获取所述待获取数据。If the sending terminal does not receive the acknowledgement information received by the receiving terminal, the data to be acquired is not stored in other terminals in the local area network. In this case, the sending terminal may obtain the data to be acquired from the server. Specifically, as shown in FIG. 3, the transmitting terminal may send a data acquisition request to the server to acquire the to-be-obtained data from the server.
若发送终端接收到接收终端反馈的确认信息,终端将执行步骤S105。If the transmitting terminal receives the confirmation information fed back by the receiving terminal, the terminal performs step S105.
S105、若接收到所述接收终端反馈的确认信息,根据所述确认信息获取所述待获取数据。S105. If the confirmation information fed back by the receiving terminal is received, the to-be-obtained data is obtained according to the confirmation information.
在一实施例中,若接收终端中存储有完整的待获取数据,该确认信息中将 包括该待获取数据的标识信息。此时,根据所述确认信息获取所述待获取数据,具体可以为:根据所述确认信息从所述接收终端获取所述待获取数据。也就是说,发送终端可以从接收终端中获取到完整的待获取数据。In an embodiment, if the receiving terminal has complete data to be acquired, the confirmation information includes the identification information of the data to be acquired. In this case, the acquiring the data to be acquired according to the confirmation information may be: acquiring the to-be-obtained data from the receiving terminal according to the confirmation information. That is to say, the transmitting terminal can obtain complete data to be acquired from the receiving terminal.
具体地,该确认信息还包括接收终端的互联网协议地址和通信端口号。根据所述确认信息从所述接收终端获取所述待获取数据,包括:根据所述接收终端的互联网协议地址与所述接收终端建立通信连接;以及根据所述通信端口号接收所述接收终端发送的所述待获取数据。Specifically, the confirmation information further includes an internet protocol address and a communication port number of the receiving terminal. Acquiring the to-be-obtained data from the receiving terminal according to the confirmation information, comprising: establishing a communication connection with the receiving terminal according to an internet protocol address of the receiving terminal; and receiving, by the receiving terminal, the sending terminal according to the communication port number The data to be acquired.
在一实施例中,该通信端口号可以为Socket端口号。发送终端可以根据接收终端的IP地址与接收终端建立TCP(Transmission Control Protocol,传输控制协议)通信连接。然后根据Socket端口号找到对应的通信端口,并通过该通信端口接收所述待获取数据。In an embodiment, the communication port number can be a Socket port number. The transmitting terminal can establish a TCP (Transmission Control Protocol) communication connection with the receiving terminal according to the IP address of the receiving terminal. Then, the corresponding communication port is found according to the Socket port number, and the data to be acquired is received through the communication port.
在另一实施例中,请参阅图4,图4为图1所示数据获取方法中步骤S105的具体流程示意图。在该实施例中,当接收终端从服务器获取数据时,服务器可以将待获取数据分成多个数据块进行传输。也就是说,该待获取数据包括多个数据块。由于网络中断等原因,该接收终端可能只获取到了其中的几个数据块,即该接收终端中只存储了部分待获取数据。此时,接收终端反馈的确认信息将包括接收终端中已存储数据块的标识信息和未存储数据块的标识信息。In another embodiment, please refer to FIG. 4. FIG. 4 is a schematic diagram of a specific process of step S105 in the data acquisition method shown in FIG. In this embodiment, when the receiving terminal acquires data from the server, the server may divide the data to be acquired into a plurality of data blocks for transmission. That is, the data to be acquired includes a plurality of data blocks. Due to network interruption and the like, the receiving terminal may only obtain a few data blocks, that is, only a part of the data to be acquired is stored in the receiving terminal. At this time, the confirmation information fed back by the receiving terminal will include the identification information of the stored data block in the receiving terminal and the identification information of the unstored data block.
其中,该已存储数据块的标识信息和未存储数据块的标识信息可以为服务器为每个数据块配置的标识。譬如,待获取数据包括4个数据块,服务器可以分别为4个数据块配置标识信息为a、b、c、d。服务器将4个数据块的标识信息发送至接收终端,同时向接收终端发送数据块。假设在接收终端接收完a数据块和b数据块后,接收终端的网络发生故障,这样接收终端就无法从服务器获取c数据块和d数据块。因此接收终端反馈的确认信息中将携带已存储数据块的标识信息a和b,以及未存储数据块的标识信息c和d。The identifier information of the stored data block and the identifier information of the unstored data block may be identifiers configured by the server for each data block. For example, if the data to be acquired includes 4 data blocks, the server may configure identification information for each of the 4 data blocks as a, b, c, and d. The server transmits the identification information of the four data blocks to the receiving terminal, and simultaneously transmits the data block to the receiving terminal. It is assumed that after the receiving terminal receives the a data block and the b data block, the network of the receiving terminal fails, so that the receiving terminal cannot acquire the c data block and the d data block from the server. Therefore, the confirmation information fed back by the receiving terminal carries the identification information a and b of the stored data block, and the identification information c and d of the unstored data block.
当确认信息包括接收终端中已存储数据块的标识信息和未存储数据块的标识信息时,该根据确认信息获取所述待获取数据,具体可以包括步骤S1051~S1052。When the confirmation information includes the identification information of the stored data block in the receiving terminal and the identification information of the unstored data block, the obtaining the data to be acquired according to the confirmation information may specifically include steps S1051 to S1052.
S1051、根据所述已存储数据块的标识信息从所述接收终端获取对应的数据块。S1051: Acquire a corresponding data block from the receiving terminal according to the identifier information of the stored data block.
具体地,该发送终端根据确认信息与接收终端建立通信连接,并根据该已 存储数据块的标识信息从该接收终端获取对应的数据块。譬如,该确认信息包括接收终端的IP地址,根据接收终端的IP地址与接收终端建立TCP通信连接,然后从接收终端中获取待获取数据的a数据块和b数据块。Specifically, the transmitting terminal establishes a communication connection with the receiving terminal according to the confirmation information, and acquires a corresponding data block from the receiving terminal according to the identification information of the stored data block. For example, the confirmation information includes an IP address of the receiving terminal, establishes a TCP communication connection with the receiving terminal according to the IP address of the receiving terminal, and then acquires a data block and b data block of the data to be acquired from the receiving terminal.
S1052、根据所述未存储数据块的标识信息从所述服务器获取对应的数据块以完成获取所述待获取数据。S1052: Acquire a corresponding data block from the server according to the identifier information of the unstored data block to complete acquiring the to-be-obtained data.
具体地,如图3所示,该发送终端根据待获取数据的标识信息以及未存储数据块的标识信息生成数据获取请求,并发送该数据获取请求至服务器,以从服务器中获取未存储数据块的标识信息对应的数据块。譬如,从服务器中获取待获取数据的c数据块和d数据块。Specifically, as shown in FIG. 3, the transmitting terminal generates a data acquisition request according to the identification information of the data to be acquired and the identification information of the unstored data block, and sends the data acquisition request to the server to obtain the unstored data block from the server. The identification information corresponds to the data block. For example, the c data block and the d data block of the data to be acquired are obtained from the server.
在一实施例中,当发送终端获取到待获取数据后,将该待获取数据存储在本地存储器中。譬如,本地硬盘中等。这样便于局域网内其他终端需要这个待获取数据时,可以从该发送终端获取数据。In an embodiment, after the sending terminal acquires the data to be acquired, the data to be acquired is stored in the local storage. For example, the local hard drive is medium. In this way, when other terminals in the local area network need the data to be acquired, data can be acquired from the sending terminal.
在一实施例中,可以通过开源组件DiskCache.NET实现开辟硬盘空间来作为缓存,以存储待获取数据。为了防止待获取数据被篡改,可以通过该DiskCache.NET组件为待获取数据进行加密。In an embodiment, the open source component DiskCache.NET can be used to create a hard disk space as a cache to store data to be acquired. In order to prevent the data to be acquired from being tampered with, the data to be acquired may be encrypted by the DiskCache.NET component.
在一实施例中,在根据所述确认信息获取所述待获取数据之后,还包括:监测与所述接收终端之间的网络状态是否处于繁忙状态;若与所述接收终端之间的网络状态处于繁忙状态,则向所述局域网内其他接收终端继续获取数据。In an embodiment, after acquiring the to-be-obtained data according to the confirmation information, the method further includes: monitoring whether a network status between the receiving terminal and the receiving terminal is in a busy state; and if a network status between the receiving terminal and the receiving terminal When it is busy, it continues to acquire data from other receiving terminals in the local area network.
其中,该繁忙状态可以为发送终端与接收终端之间的网络信号强度低于阈值时的状态,即网络信号差。当然,该繁忙状态还可以为其他状态,在此不做具体限制。The busy state may be a state when the network signal strength between the transmitting terminal and the receiving terminal is lower than a threshold, that is, a network signal difference. Of course, the busy state can also be other states, and no specific restrictions are imposed here.
当发送终端监测到与接收终端之间的网络状态处于繁忙状态时,可以向局域网内其他接收终端继续接收数据。譬如,当步骤S105接收到多条确认信息时,可以在其他确认信息中选择一个确认信息,并根据该确认信息向对应的接收终端继续获取数据。When the transmitting terminal detects that the network state between the receiving terminal and the receiving terminal is busy, it can continue to receive data to other receiving terminals in the local area network. For example, when a plurality of pieces of confirmation information are received in step S105, one piece of confirmation information may be selected among other confirmation information, and the data may be continuously acquired from the corresponding receiving terminal according to the confirmation information.
当然,在监测到与接收终端之间的网络状态处于繁忙状态时,也可以向服务器继续获取数据。Of course, when it is monitored that the network state between the receiving terminal and the receiving terminal is busy, the data can also be continuously obtained from the server.
另外,在一实施例中的数据获取方法可以以插件的形式嵌入到各类应用系统中,譬如,以插件的形式嵌入到人寿保险系统应用中。也可以基于.net的服务部署技术,将该数据获取方法嵌入到Windows服务中,并打包成Windows服务。 终端通过部署该Windows服务,就可以使用该数据获取方法。In addition, the data acquisition method in an embodiment may be embedded in various application systems in the form of a plug-in, for example, embedded in a life insurance system application in the form of a plug-in. The data acquisition method can also be embedded into the Windows service based on the service deployment technology of .NET and packaged into a Windows service. The terminal can use the data acquisition method by deploying the Windows service.
本实施例中的数据获取方法,通过在检测到数据获取指令时,获取待获取数据的标识信息;根据待获取数据的标识信息生成广播数据包,并向局域网内至少一个接收终端发送广播数据包;在接收到接收终端反馈的确认信息后,根据确认信息获取待获取数据。该方法可以合理利用服务器和局域网的资源,在局域网内的接收终端中存储有待获取数据的情况下,从接收终端获取数据,以缓解直接向服务器获取数据造成的访问压力,同时,从局域网内获取数据的速度相对较快,可以提高数据获取的效率。另外,由于服务器的访问压力得到大幅度缓解,也可以进一步提高局域网内终端向服务器获取数据的效率。The data obtaining method in the embodiment obtains the identification information of the data to be acquired when the data acquisition instruction is detected; generates the broadcast data packet according to the identification information of the data to be acquired, and sends the broadcast data packet to at least one receiving terminal in the local area network. After receiving the confirmation information fed back by the receiving terminal, the data to be acquired is obtained according to the confirmation information. The method can reasonably utilize the resources of the server and the local area network, and obtain the data from the receiving terminal when the receiving terminal in the local area network stores the data to be acquired, so as to alleviate the access pressure caused by directly acquiring data from the server, and obtain the access pressure from the local area network. The speed of the data is relatively fast, which can improve the efficiency of data acquisition. In addition, since the access pressure of the server is greatly alleviated, the efficiency of the terminal to obtain data from the server in the local area network can be further improved.
本申请实施例还提供一种数据获取装置,该数据获取装置用于执行前述任一项数据获取方法。具体地,请参阅图5,图5是本申请实施例提供的一种数据获取装置的示意性框图。数据获取装置300可以安装于台式电脑、平板电脑、手提电脑、个人数字助理(PAD)或平板电脑等终端中。The embodiment of the present application further provides a data obtaining apparatus, which is used to execute any of the foregoing data acquiring methods. Specifically, please refer to FIG. 5. FIG. 5 is a schematic block diagram of a data acquiring apparatus according to an embodiment of the present application. The data acquisition device 300 can be installed in a terminal such as a desktop computer, a tablet computer, a laptop computer, a personal digital assistant (PAD), or a tablet computer.
一般来说,局域网内包括多个终端。为了方便区分各个终端,在某一次数据交互过程中,可以将发送数据的终端称为发送终端,将接收数据的终端称为接收终端。Generally, a plurality of terminals are included in a local area network. In order to facilitate the differentiation of the terminals, the terminal that sends the data may be referred to as the transmitting terminal, and the terminal that receives the data is referred to as the receiving terminal.
以下将以该数据获取装置300安装在发送终端为例进行描述。如图5所示,数据获取装置300包括标识获取单元301、生成单元302、发送单元303、判断单元304和数据获取单元305。The following description will be made by taking the data acquisition device 300 installed in the transmitting terminal as an example. As shown in FIG. 5, the data acquisition device 300 includes an identification acquisition unit 301, a generation unit 302, a transmission unit 303, a determination unit 304, and a data acquisition unit 305.
标识获取单元301,用于若检测到数据获取指令,获取待获取数据的标识信息。The identifier obtaining unit 301 is configured to obtain identification information of the data to be acquired if the data acquisition instruction is detected.
当用户想要查看某些数据时,可以在终端中执行点击等操作,以使得标识获取单元301可以检测到数据获取指令,并根据数据获取指令获取待获取数据的标识信息。When the user wants to view certain data, an operation such as clicking may be performed in the terminal, so that the identifier obtaining unit 301 can detect the data acquisition instruction, and acquire the identification information of the data to be acquired according to the data acquisition instruction.
其中,该待获取数据的标识信息可以为URL地址、文件名称等唯一识别出该待获取数据的标识,在此不做具体限制。The identifier information of the to-be-obtained data may be an identifier that uniquely identifies the data to be acquired, such as a URL address and a file name, and is not specifically limited herein.
生成单元302,用于根据所述待获取数据的标识信息生成广播数据包。The generating unit 302 is configured to generate a broadcast data packet according to the identifier information of the data to be acquired.
在标识获取单元301获取到待获取数据的标识信息后,生成单元302将根据标识信息生成广播数据包。其中,该广播数据包将携带有待获取数据的标识 信息。After the identifier obtaining unit 301 acquires the identifier information of the data to be acquired, the generating unit 302 generates a broadcast data packet according to the identifier information. The broadcast data packet carries the identification information of the data to be acquired.
在一实施例中,如图6所示,图6为本申请一实施例中数据获取装置的另一示意性框图。该生成单元302包括获取子单元3021、筛选子单元3022和生成子单元3023。In an embodiment, as shown in FIG. 6, FIG. 6 is another schematic block diagram of a data acquiring apparatus according to an embodiment of the present application. The generating unit 302 includes an obtaining subunit 3021, a screening subunit 3022, and a generating subunit 3023.
该获取子单元3021,用于获取所述局域网内所有所述接收终端的互联网协议地址。The obtaining subunit 3021 is configured to acquire an internet protocol address of all the receiving terminals in the local area network.
在一实施例中,获取子单元3021在获取局域网内的所有接收终端的互联网协议地址(Internet Protocol Address,简称IP地址)时,也需要获取发送终端的IP地址。这样可以方便局域网内各个终端进行通信。In an embodiment, the obtaining sub-unit 3021 needs to acquire the IP address of the sending terminal when acquiring the Internet Protocol Address (IP address) of all the receiving terminals in the local area network. This can facilitate communication between various terminals in the LAN.
该筛选子单元3022,用于对所述局域网内所有所述互联网协议地址进行筛选以获得在线的互联网协议地址。The screening sub-unit 3022 is configured to filter all the Internet Protocol addresses in the local area network to obtain an online Internet Protocol address.
其中,该在线的互联网协议地址可以指已经连接上网络的互联网协议地址。The online internet protocol address may refer to an internet protocol address that has been connected to the network.
具体地,在一实施例中,筛选子单元3022可以通过ping(Packet Internet Groper,因特网包探索器)命令过滤出在线的IP地址。当然,筛选子单元3022也可以采用其他方式过滤在线的IP地址,在此不做具体限制。Specifically, in an embodiment, the screening sub-unit 3022 can filter out the online IP address by a ping (Packet Internet Groper) command. Of course, the filtering sub-unit 3022 may also filter the online IP address in other manners, and no specific limitation is imposed herein.
通过筛选子单元3022对获取子单元3021获取到的所有IP地址进行在线筛选,可以使得广播数据包更有针对性地发送到各个在线的接收终端中,使得局域网内网络资源得到合理利用,避免局域网发生拥堵。The online filtering of all the IP addresses obtained by the obtaining sub-unit 3021 is performed by the filtering sub-unit 3022, so that the broadcast data packets can be more specifically transmitted to the receiving terminals of the online, so that the network resources in the local area network can be reasonably utilized to avoid the local area network. Congestion has occurred.
该生成子单元3023,用于根据所述待获取数据的标识信息和在线的互联网协议地址生成广播数据包。The generating subunit 3023 is configured to generate a broadcast data packet according to the identification information of the data to be acquired and the Internet protocol address of the online.
在一实施例中,生成子单元3023根据待获取数据的标识信息、在线的IP地址和发送终端的IP地址生成广播数据包。In an embodiment, the generating subunit 3023 generates a broadcast data packet according to the identification information of the data to be acquired, the online IP address, and the IP address of the transmitting terminal.
当然,在其他实施例中,生成单元302也可以不包括筛选子单元3022。也就是说,在获取子单元3021获取所述局域网内所有所述接收终端的互联网协议地址后,生成子单元3023将根据所述待获取数据的标识信息和所有所述接收终端的互联网协议地址生成广播数据包。这样,在后续发送广播数据包时,局域网内所有接收终端都会接收到该广播数据包。Of course, in other embodiments, the generating unit 302 may also not include the filtering sub-unit 3022. That is, after the obtaining sub-unit 3021 acquires the Internet Protocol addresses of all the receiving terminals in the local area network, the generating sub-unit 3023 generates the identifier information according to the to-be-obtained data and the Internet Protocol addresses of all the receiving terminals. Broadcast packet. In this way, when the broadcast data packet is subsequently sent, all the receiving terminals in the local area network receive the broadcast data packet.
发送单元303,用于向局域网内至少一个接收终端发送所述广播数据包。The sending unit 303 is configured to send the broadcast data packet to at least one receiving terminal in the local area network.
在一实施例中,发送单元303具体可以通过UDP(User Data Protocol,用户数据报协议)协议发送该广播数据包。In an embodiment, the sending unit 303 may specifically send the broadcast data packet by using a UDP (User Data Protocol) protocol.
在本实施例中,局域网内的接收终端在接收到广播数据包后,将根据该广播数据包中的待获取数据的标识信息在本地查找是否存在对应的待获取数据。若接收终端判断出本地存储有该待获取数据,那么接收终端会生成一个确认信息,并将该确认信息通过局域网反馈给发送终端,以告知发送终端其存储有待获取数据。In this embodiment, after receiving the broadcast data packet, the receiving terminal in the local area network searches locally for the corresponding data to be acquired according to the identification information of the data to be acquired in the broadcast data packet. If the receiving terminal determines that the data to be acquired is stored locally, the receiving terminal generates an acknowledgement message, and feeds the acknowledgement information to the sending terminal through the local area network to notify the sending terminal that the data to be acquired is stored.
判断单元304,用于判断是否接收到所述接收终端反馈的确认信息,其中,所述确认信息为所述接收终端在接收到所述广播数据包后,根据所述待获取数据的标识信息查找到对应的待获取数据时生成的反馈信息。The determining unit 304 is configured to determine whether the acknowledgment information fed back by the receiving terminal is received, where the acknowledgment information is that, after receiving the broadcast data packet, the receiving terminal searches for the identifier information of the data to be acquired. Feedback information generated when the corresponding data to be acquired is obtained.
在发送单元303发送完广播数据包后,判断单元304将不断地监听是否接收到接收终端反馈的确认信息。After the transmitting unit 303 has transmitted the broadcast data packet, the determining unit 304 will continuously monitor whether or not the acknowledgement information fed back by the receiving terminal is received.
在一实施例中,判断单元304具体用于判断预设时间内是否接收到所述接收终端反馈的确认信息。如果超过预设时间还没有接收到确认信息,那就默认局域网内其他接收终端没有待获取数据,可以避免发送终端长时间处于等待状态。In an embodiment, the determining unit 304 is specifically configured to determine whether the confirmation information fed back by the receiving terminal is received within a preset time. If the confirmation message has not been received before the preset time, the other receiving terminals in the local area network have no data to be acquired, and the sending terminal can be prevented from waiting for a long time.
若判断单元304未接收到接收终端反馈的确认信息,判断单元304向数据获取单元305发送第一信号。若判断单元304接收到接收终端反馈的确认信息,此时判断单元304向数据获取单元305发送第二信号。If the determining unit 304 does not receive the confirmation information fed back by the receiving terminal, the determining unit 304 transmits the first signal to the data acquiring unit 305. If the determining unit 304 receives the confirmation information fed back by the receiving terminal, the determining unit 304 transmits a second signal to the data acquiring unit 305.
数据获取单元305,用于若接收到所述接收终端反馈的确认信息,根据所述确认信息获取所述待获取数据。The data obtaining unit 305 is configured to obtain the acknowledgement information fed back by the receiving terminal, and acquire the to-be-obtained data according to the confirmation information.
在一实施例中,当数据获取单元305接收到判断单元304发送的第一信号时,说明局域网内其他终端中没有待获取数据,此时数据获取单元305可以向服务器获取待获取数据。具体地,数据获取单元305向所述服务器发送数据获取请求以从所述服务器获取所述待获取数据。In an embodiment, when the data acquisition unit 305 receives the first signal sent by the determining unit 304, it indicates that there is no data to be acquired in other terminals in the local area network, and the data acquiring unit 305 can obtain the data to be acquired from the server. Specifically, the data acquisition unit 305 transmits a data acquisition request to the server to acquire the data to be acquired from the server.
在另一实施例中,当数据获取单元305接收到判断单元304发送的第二信号时,说明局域网内其他终端中存储有待获取数据,此时数据获取单元305可以根据确认信息获取所述待获取数据。In another embodiment, when the data acquisition unit 305 receives the second signal sent by the determining unit 304, it indicates that the data to be acquired is stored in other terminals in the local area network, and the data acquiring unit 305 can obtain the to-be-acquired according to the confirmation information. data.
具体地,在一实施例中,若接收终端中存储有完整的待获取数据,该确认信息中将包括该待获取数据的标识信息。此时,数据获取单元305具体用于根据所述确认信息从所述接收终端获取所述待获取数据。也就是说,数据获取单元305可以从接收终端中获取到完整的待获取数据。Specifically, in an embodiment, if the complete data to be acquired is stored in the receiving terminal, the confirmation information includes the identification information of the data to be acquired. At this time, the data obtaining unit 305 is specifically configured to acquire the to-be-obtained data from the receiving terminal according to the confirmation information. That is to say, the data acquisition unit 305 can acquire complete data to be acquired from the receiving terminal.
具体地,该确认信息还包括接收终端的互联网协议地址和通信端口号。数据获取单元305根据所述接收终端的互联网协议地址与所述接收终端建立通信连接;以及根据所述通信端口号接收所述接收终端发送的所述待获取数据。Specifically, the confirmation information further includes an internet protocol address and a communication port number of the receiving terminal. The data obtaining unit 305 establishes a communication connection with the receiving terminal according to the Internet Protocol address of the receiving terminal, and receives the to-be-obtained data sent by the receiving terminal according to the communication port number.
在一实施例中,该通信端口号可以为Socket端口号。数据获取单元305可以根据接收终端的IP地址与接收终端建立TCP(Transmission Control Protocol,传输控制协议)通信连接,然后根据Socket端口号找到对应的通信端口,并通过该通信端口接收所述待获取数据。In an embodiment, the communication port number can be a Socket port number. The data acquisition unit 305 can establish a TCP (Transmission Control Protocol) communication connection with the receiving terminal according to the IP address of the receiving terminal, and then find a corresponding communication port according to the Socket port number, and receive the data to be acquired through the communication port. .
具体地,在另一实施例中,当接收终端从服务器获取数据时,服务器可以将待获取数据分成多个数据块进行传输。也就是说,该待获取数据包括多个数据块。由于网络中断等原因,该接收终端可能只获取到了其中的几个数据块,即该接收终端中只存储了部分待获取数据。此时,接收终端反馈的确认信息将包括接收终端中已存储数据块的标识信息和未存储数据块的标识信息。其中,该已存储数据块的标识信息和未存储数据块的标识信息可以为服务器为每个数据块配置的标识。Specifically, in another embodiment, when the receiving terminal acquires data from the server, the server may divide the data to be acquired into a plurality of data blocks for transmission. That is, the data to be acquired includes a plurality of data blocks. Due to network interruption and the like, the receiving terminal may only obtain a few data blocks, that is, only a part of the data to be acquired is stored in the receiving terminal. At this time, the confirmation information fed back by the receiving terminal will include the identification information of the stored data block in the receiving terminal and the identification information of the unstored data block. The identifier information of the stored data block and the identifier information of the unstored data block may be identifiers configured by the server for each data block.
当确认信息包括接收终端中已存储数据块的标识信息和未存储数据块的标识信息时,该数据获取单元305具体用于根据所述已存储数据块的标识信息从所述接收终端获取对应的数据块;以及根据所述未存储数据块的标识信息从所述服务器获取对应的数据块以完成获取所述待获取数据。When the confirmation information includes the identification information of the stored data block in the receiving terminal and the identification information of the unstored data block, the data obtaining unit 305 is specifically configured to acquire, according to the identification information of the stored data block, the corresponding terminal from the receiving terminal. And obtaining a corresponding data block from the server according to the identification information of the unstored data block to complete acquiring the to-be-obtained data.
具体地,该数据获取单元305根据确认信息与接收终端建立通信连接,并根据该已存储数据块的标识信息从该接收终端获取对应的数据块。该数据获取单元305还根据待获取数据的标识信息以及未存储数据块的标识信息生成数据获取请求,并发送该数据获取请求至服务器,以从服务器中获取未存储数据块的标识信息对应的数据块。Specifically, the data obtaining unit 305 establishes a communication connection with the receiving terminal according to the confirmation information, and acquires a corresponding data block from the receiving terminal according to the identification information of the stored data block. The data obtaining unit 305 further generates a data acquisition request according to the identification information of the data to be acquired and the identification information of the unstored data block, and sends the data acquisition request to the server to acquire data corresponding to the identification information of the unstored data block from the server. Piece.
在一实施例中,如图6所示,该数据获取装置300还包括存储单元306。当数据获取单元305获取到待获取数据后,存储单元306将该待获取数据存储在本地存储器中。譬如,本地硬盘中等。这样便于局域网内其他终端需要这个待获取数据时,可以从该发送终端获取数据。In an embodiment, as shown in FIG. 6, the data acquisition device 300 further includes a storage unit 306. After the data obtaining unit 305 acquires the data to be acquired, the storage unit 306 stores the data to be acquired in the local storage. For example, the local hard drive is medium. In this way, when other terminals in the local area network need the data to be acquired, data can be acquired from the sending terminal.
在一实施例中,存储单元306可以通过开源组件DiskCache.NET实现开辟硬盘空间来作为缓存,以存储待获取数据。为了防止待获取数据被篡改,可以通过该DiskCache.NET组件为待获取数据进行加密。In an embodiment, the storage unit 306 can open up a hard disk space as a cache through the open source component DiskCache.NET to store data to be acquired. In order to prevent the data to be acquired from being tampered with, the data to be acquired may be encrypted by the DiskCache.NET component.
在一实施例中,该数据获取装置300还包括监测单元。该监测单元用于监测与所述接收终端之间的网络状态是否处于繁忙状态。当监测单元监测出与所述接收终端之间的网络状态处于繁忙状态,则向数据获取单元305发送第三信号,以使得数据获取单元305根据该第三信号向局域网内其他接收终端继续获取数据。In an embodiment, the data acquisition device 300 further includes a monitoring unit. The monitoring unit is configured to monitor whether a network status with the receiving terminal is in a busy state. When the monitoring unit detects that the network status between the receiving terminal and the receiving terminal is in a busy state, sending a third signal to the data acquiring unit 305, so that the data acquiring unit 305 continues to acquire data according to the third signal to other receiving terminals in the local area network. .
譬如,当数据获取单元305接收到多条确认信息时,可以在其他确认信息中选择一个确认信息,并根据该确认信息向对应的接收终端继续获取数据。For example, when the data acquisition unit 305 receives a plurality of pieces of confirmation information, it may select one of the other confirmation information, and continue to acquire data from the corresponding receiving terminal according to the confirmation information.
当然,在监测单元监测到与接收终端之间的网络状态处于繁忙状态时,监测单元也可以向数据获取单元305发送第四信号,以使得数据获取单元305根据第四信号向服务器继续获取数据。Of course, when the monitoring unit detects that the network state between the receiving terminal and the receiving terminal is in a busy state, the monitoring unit may also send a fourth signal to the data acquiring unit 305, so that the data acquiring unit 305 continues to acquire data from the server according to the fourth signal.
本实施例中的数据获取装置300,在局域网内的接收终端中存储有待获取数据的情况下,从接收终端获取数据,以减轻服务器的访问压力,同时,从局域网内获取数据的速度较快,可以提高数据获取的效率。The data obtaining apparatus 300 in this embodiment acquires data from the receiving terminal in the case where the receiving terminal in the local area network stores the data to be acquired, so as to reduce the access pressure of the server, and at the same time, the data is quickly acquired from the local area network. Can improve the efficiency of data acquisition.
上述数据获取装置可以实现为一种计算机程序的形式,计算机程序可以在如图7所示的计算机设备上运行。The above data acquisition means can be implemented in the form of a computer program which can be run on a computer device as shown in FIG.
请参阅图7,图7是本申请实施例提供的一种计算机设备的示意性框图。该计算机设备400设备可以是终端。该终端可以是平板电脑、笔记本电脑、台式电脑、个人数字助理等电子设备。Please refer to FIG. 7. FIG. 7 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 400 device can be a terminal. The terminal can be an electronic device such as a tablet computer, a notebook computer, a desktop computer, or a personal digital assistant.
参阅图7,该计算机设备400包括通过系统总线401连接的处理器402、存储器和网络接口405,其中,存储器可以包括非易失性存储介质403和内存储器404。Referring to FIG. 7, the computer device 400 includes a processor 402, a memory, and a network interface 405 connected by a system bus 401, wherein the memory can include a non-volatile storage medium 403 and an internal memory 404.
该非易失性存储介质403可存储操作系统4031和计算机程序4032。该计算机程序4032包括程序指令,该程序指令被执行时,可使得处理器402执行一种数据获取方法。The non-volatile storage medium 403 can store an operating system 4031 and a computer program 4032. The computer program 4032 includes program instructions that, when executed, cause the processor 402 to perform a data acquisition method.
该处理器402用于提供计算和控制能力,支撑整个计算机设备400的运行。The processor 402 is used to provide computing and control capabilities to support the operation of the entire computer device 400.
该内存储器404为非易失性存储介质403中的计算机程序4032的运行提供环境,该计算机程序4032被处理器402执行时,可使得处理器402执行一种数据获取方法。The internal memory 404 provides an environment for the operation of the computer program 4032 in the non-volatile storage medium 403, which when executed by the processor 402, causes the processor 402 to perform a data acquisition method.
该网络接口405用于进行网络通信,如发送分配的任务等。本领域技术人员可以理解,图7中示出的结构,仅仅是与本申请方案相关的部分结构的框图, 并不构成对本申请方案所应用于其上的计算机设备400的限定,具体的计算机设备400可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。The network interface 405 is used for network communication, such as sending assigned tasks and the like. It will be understood by those skilled in the art that the structure shown in FIG. 7 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation of the computer device 400 to which the solution of the present application is applied, and a specific computer device. 400 may include more or fewer components than shown in the figures, or some components may be combined, or have different component arrangements.
其中,所述处理器402用于运行存储在存储器中的计算机程序4032,以实现如下功能:若检测到数据获取指令,获取待获取数据的标识信息;根据所述待获取数据的标识信息生成广播数据包;向局域网内至少一个接收终端发送所述广播数据包;判断是否接收到所述接收终端反馈的确认信息,其中,所述确认信息为所述接收终端在接收到所述广播数据包后,根据所述待获取数据的标识信息查找到对应的待获取数据时生成的反馈信息;若接收到所述接收终端反馈的确认信息,根据所述确认信息获取所述待获取数据。The processor 402 is configured to run the computer program 4032 stored in the memory to implement the following functions: if the data acquisition instruction is detected, the identification information of the data to be acquired is acquired; and the broadcast is generated according to the identification information of the data to be acquired. Transmitting the broadcast data packet to at least one receiving terminal in the local area network; determining whether the acknowledgment information fed back by the receiving terminal is received, wherein the acknowledgment information is that the receiving terminal after receiving the broadcast data packet And obtaining, according to the identifier information of the to-be-obtained data, the feedback information generated when the corresponding data to be acquired is obtained; and if the confirmation information fed back by the receiving terminal is received, the data to be acquired is obtained according to the confirmation information.
在一实施例中,所述待获取数据包括多个数据块;所述确认信息包括所述接收终端中已存储数据块的标识信息和未存储数据块的标识信息;处理器402在执行所述根据所述确认信息获取所述待获取数据时,具体执行如下程序:根据所述已存储数据块的标识信息从所述接收终端获取对应的数据块;以及根据所述未存储数据块的标识信息从所述服务器获取对应的数据块以完成获取所述待获取数据。In an embodiment, the data to be acquired includes a plurality of data blocks; the confirmation information includes identification information of the stored data block in the receiving terminal and identification information of the unstored data block; the processor 402 is performing the When the data to be acquired is obtained according to the confirmation information, the following procedure is specifically executed: acquiring a corresponding data block from the receiving terminal according to the identification information of the stored data block; and identifying information according to the unstored data block Obtaining a corresponding data block from the server to complete acquiring the to-be-obtained data.
在一实施例中,处理器402在执行根据所述确认信息获取所述待获取数据时,具体执行如下程序:根据所述确认信息从所述接收终端获取所述待获取数据。In an embodiment, when performing the acquiring the to-be-obtained data according to the confirmation information, the processor 402 specifically executes a process of: acquiring the to-be-obtained data from the receiving terminal according to the confirmation information.
在一实施例中,处理器402在执行根据所述待获取数据的标识信息生成广播数据包时,具体执行如下程序:获取所述局域网内所有所述接收终端的互联网协议地址;对所述局域网内所有所述互联网协议地址进行筛选以获得在线的互联网协议地址;根据所述待获取数据的标识信息和在线的互联网协议地址生成广播数据包。In an embodiment, when the processor 402 is configured to generate a broadcast data packet according to the identifier information of the data to be acquired, the following is specifically performed: acquiring an internet protocol address of all the receiving terminals in the local area network; All the Internet Protocol addresses are filtered to obtain an online Internet Protocol address; the broadcast data packet is generated according to the identification information of the data to be acquired and the online Internet Protocol address.
在一实施例中,所述确认信息还包括所述接收终端的互联网协议地址和通信端口号;处理器402在执行根据所述确认信息从所述接收终端获取所述待获取数据时,具体执行如下程序:根据所述接收终端的互联网协议地址与所述接收终端建立通信连接;以及根据所述通信端口号接收所述接收终端发送的所述待获取数据。In an embodiment, the confirmation information further includes an internet protocol address and a communication port number of the receiving terminal; and the processor 402 performs specific execution when acquiring the to-be-obtained data from the receiving terminal according to the confirmation information. a program of: establishing a communication connection with the receiving terminal according to an internet protocol address of the receiving terminal; and receiving the to-be-obtained data sent by the receiving terminal according to the communication port number.
在本申请实施例中,处理器402可以是中央处理单元,该处理器402还可 以是其他通用处理器、数字信号处理器、专用集成电路、现成可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。In the embodiment of the present application, the processor 402 may be a central processing unit, and the processor 402 may also be other general purpose processors, digital signal processors, application specific integrated circuits, off-the-shelf programmable gate arrays or other programmable logic devices, and discrete Gate or transistor logic, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
在本申请的另一实施例中提供一种存储介质。该存储介质可以为计算机可读存储介质。该存储介质存储有计算机程序,其中计算机程序包括程序指令。该程序指令被处理器执行时实现:若检测到数据获取指令,获取待获取数据的标识信息;根据所述待获取数据的标识信息生成广播数据包;向局域网内至少一个接收终端发送所述广播数据包;判断是否接收到所述接收终端反馈的确认信息,其中,所述确认信息为所述接收终端在接收到所述广播数据包后,根据所述待获取数据的标识信息查找到对应的待获取数据时生成的反馈信息;若接收到所述接收终端反馈的确认信息,根据所述确认信息获取所述待获取数据。In another embodiment of the present application, a storage medium is provided. The storage medium can be a computer readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When the program instruction is executed by the processor, if the data acquisition instruction is detected, the identification information of the data to be acquired is acquired; the broadcast data packet is generated according to the identification information of the data to be acquired; and the broadcast is sent to at least one receiving terminal in the local area network. Determining whether the acknowledgment information fed back by the receiving terminal is received, wherein the acknowledgment information is that the receiving terminal searches for the corresponding information according to the identification information of the data to be acquired after receiving the broadcast data packet The feedback information generated when the data is to be acquired; if the confirmation information fed back by the receiving terminal is received, the data to be acquired is obtained according to the confirmation information.
在一实施例中,所述待获取数据包括多个数据块;所述确认信息包括所述接收终端中已存储数据块的标识信息和未存储数据块的标识信息;该程序指令被处理器执行所述根据所述确认信息获取所述待获取数据时,具体实现:根据所述已存储数据块的标识信息从所述接收终端获取对应的数据块;以及根据所述未存储数据块的标识信息从所述服务器获取对应的数据块以完成获取所述待获取数据。In an embodiment, the data to be acquired includes a plurality of data blocks; the confirmation information includes identification information of the stored data block in the receiving terminal and identification information of the unstored data block; the program instruction is executed by the processor When the obtaining the data to be acquired according to the confirmation information, the method further: obtaining, according to the identifier information of the stored data block, a corresponding data block from the receiving terminal; and determining, according to the identifier information of the unstored data block Obtaining a corresponding data block from the server to complete acquiring the to-be-obtained data.
在一实施例中,该程序指令被处理器执行根据所述确认信息获取所述待获取数据时,具体实现:根据所述确认信息从所述接收终端获取所述待获取数据。In an embodiment, when the program instruction is executed by the processor to acquire the to-be-obtained data according to the confirmation information, the specific implementation is: acquiring the to-be-obtained data from the receiving terminal according to the confirmation information.
在一实施例中,该程序指令被处理器执行根据所述待获取数据的标识信息生成广播数据包时,具体实现:获取所述局域网内所有所述接收终端的互联网协议地址;对所述局域网内所有所述互联网协议地址进行筛选以获得在线的互联网协议地址;根据所述待获取数据的标识信息和在线的互联网协议地址生成广播数据包。In an embodiment, when the program instruction is executed by the processor to generate a broadcast data packet according to the identification information of the data to be acquired, the specific implementation is: acquiring an internet protocol address of all the receiving terminals in the local area network; All the Internet Protocol addresses are filtered to obtain an online Internet Protocol address; the broadcast data packet is generated according to the identification information of the data to be acquired and the online Internet Protocol address.
在一实施例中,所述确认信息还包括所述接收终端的互联网协议地址和通信端口号;该程序指令被处理器执行根据所述确认信息从所述接收终端获取所述待获取数据时,具体实现:根据所述接收终端的互联网协议地址与所述接收终端建立通信连接;以及根据所述通信端口号接收所述接收终端发送的所述待获取数据。In an embodiment, the confirmation information further includes an internet protocol address and a communication port number of the receiving terminal; and the program instruction is executed by the processor, when acquiring the to-be-obtained data from the receiving terminal according to the confirmation information, The specific implementation is: establishing a communication connection with the receiving terminal according to the Internet Protocol address of the receiving terminal; and receiving the to-be-obtained data sent by the receiving terminal according to the communication port number.
该存储介质可以是U盘、移动硬盘、只读存储器(ROM,Read-Only  Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The storage medium may be a medium that can store program codes, such as a USB flash drive, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的数据获取装置和单元的具体工作过程,可以参考前述数据获取方法实施例中的对应过程,在此不再赘述。Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both, for clarity of hardware and software. Interchangeability, the composition and steps of the various examples have been generally described in terms of function in the above description. A person skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working process of the data obtaining apparatus and the unit described above may refer to the corresponding process in the foregoing data obtaining method embodiment, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的数据获取装置和数据获取方法,可以通过其它的方式实现。例如,各个单元的划分仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。本申请实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。本申请实施例数据获取装置中的单元可以根据实际需要进行合并、划分和删减。另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以是两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In the several embodiments provided by the present application, it should be understood that the disclosed data acquisition apparatus and data acquisition method may be implemented in other manners. For example, the division of each unit is only a logical function division, and there may be another division manner in actual implementation. The steps in the method of the embodiment of the present application may be sequentially adjusted, merged, and deleted according to actual needs. The units in the data obtaining apparatus of the embodiment of the present application may be combined, divided, and deleted according to actual needs. In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
该集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分,或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,终端,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。The integrated unit can be stored in a storage medium if it is implemented in the form of a software functional unit and sold or used as a standalone product. Based on such understanding, the technical solution of the present application may be in essence or part of the contribution to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium. There are a number of instructions for causing a computer device (which may be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The foregoing is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto, and any equivalents can be easily conceived by those skilled in the art within the technical scope disclosed in the present application. Modifications or substitutions are intended to be included within the scope of the present application. Therefore, the scope of protection of this application should be determined by the scope of protection of the claims.

Claims (20)

  1. 一种数据获取方法,其包括:A data acquisition method includes:
    若检测到数据获取指令,获取待获取数据的标识信息;If the data acquisition instruction is detected, obtaining identification information of the data to be acquired;
    根据所述待获取数据的标识信息生成广播数据包;Generating a broadcast data packet according to the identification information of the data to be acquired;
    向局域网内至少一个接收终端发送所述广播数据包;Transmitting the broadcast data packet to at least one receiving terminal in the local area network;
    判断是否接收到所述接收终端反馈的确认信息,其中,所述确认信息为所述接收终端在接收到所述广播数据包后,根据所述待获取数据的标识信息查找到对应的待获取数据时生成的反馈信息;Determining whether the acknowledgment information fed back by the receiving terminal is received, wherein the acknowledgment information is that, after receiving the broadcast data packet, the receiving terminal searches for corresponding data to be acquired according to the identification information of the data to be acquired. Feedback information generated at the time;
    若接收到所述接收终端反馈的确认信息,根据所述确认信息获取所述待获取数据。And receiving the confirmation information fed back by the receiving terminal, and acquiring the to-be-obtained data according to the confirmation information.
  2. 根据权利要求1所述的数据获取方法,其中,所述待获取数据包括多个数据块;所述确认信息包括所述接收终端中已存储数据块的标识信息和未存储数据块的标识信息;The data acquisition method according to claim 1, wherein the data to be acquired includes a plurality of data blocks; the confirmation information includes identification information of the stored data blocks in the receiving terminal and identification information of the unstored data blocks;
    所述根据所述确认信息获取所述待获取数据,包括:根据所述已存储数据块的标识信息从所述接收终端获取对应的数据块;以及根据所述未存储数据块的标识信息从所述服务器获取对应的数据块以完成获取所述待获取数据。Acquiring the to-be-obtained data according to the confirmation information, comprising: acquiring a corresponding data block from the receiving terminal according to the identifier information of the stored data block; and obtaining, according to the identifier information of the unstored data block, from the The server obtains a corresponding data block to complete acquiring the to-be-obtained data.
  3. 根据权利要求1所述的数据获取方法,其中,所述根据所述确认信息获取所述待获取数据,包括:根据所述确认信息从所述接收终端获取所述待获取数据。The data acquisition method according to claim 1, wherein the obtaining the data to be acquired according to the confirmation information comprises: acquiring the data to be acquired from the receiving terminal according to the confirmation information.
  4. 根据权利要求1所述的数据获取方法,其中,所述根据所述待获取数据的标识信息生成广播数据包,包括:获取所述局域网内所有所述接收终端的互联网协议地址;对所述局域网内所有所述互联网协议地址进行筛选以获得在线的互联网协议地址;以及根据所述待获取数据的标识信息和在线的互联网协议地址生成广播数据包。The data acquisition method according to claim 1, wherein the generating the broadcast data packet according to the identification information of the data to be acquired comprises: acquiring an internet protocol address of all the receiving terminals in the local area network; All the internet protocol addresses are filtered to obtain an online internet protocol address; and the broadcast data packet is generated according to the identification information of the data to be acquired and the online internet protocol address.
  5. 根据权利要求3所述的数据获取方法,其中,所述确认信息还包括所述接收终端的互联网协议地址和通信端口号;The data acquisition method according to claim 3, wherein the confirmation information further comprises an internet protocol address and a communication port number of the receiving terminal;
    所述根据所述确认信息从所述接收终端获取所述待获取数据,包括:根据所述接收终端的互联网协议地址与所述接收终端建立通信连接;以及根据所述通信端口号接收所述接收终端发送的所述待获取数据。Acquiring the to-be-acquired data from the receiving terminal according to the confirmation information, comprising: establishing a communication connection with the receiving terminal according to an internet protocol address of the receiving terminal; and receiving the receiving according to the communication port number The to-be-obtained data sent by the terminal.
  6. 根据权利要求1所述的数据获取方法,其中,所述根据所述待获取数据的标识信息生成广播数据包,包括:获取所述局域网内所有所述接收终端的互联网协议地址;以及根据所述待获取数据的标识信息和所有所述接收终端的互联网协议地址生成广播数据包。The data acquisition method according to claim 1, wherein the generating the broadcast data packet according to the identification information of the data to be acquired comprises: acquiring an internet protocol address of all the receiving terminals in the local area network; The identification information of the data to be acquired and the Internet Protocol address of all the receiving terminals generate a broadcast data packet.
  7. 根据权利要求1所述的数据获取方法,其中,在所述根据所述确认信息获取所述待获取数据之后,还包括:监测与所述接收终端之间的网络状态是否处于繁忙状态;若与所述接收终端之间的网络状态处于繁忙状态,则向所述局域网内其他接收终端继续获取数据。The data acquisition method according to claim 1, wherein after the obtaining the data to be acquired according to the confirmation information, the method further comprises: monitoring whether a network status with the receiving terminal is in a busy state; When the network status between the receiving terminals is in a busy state, data is continuously acquired to other receiving terminals in the local area network.
  8. 根据权利要求1所述的数据获取方法,其中,所述向局域网内至少一个接收终端发送所述广播数据包,包括:通过UDP协议向局域网内至少一个接收终端发送所述广播数据包。The data acquisition method according to claim 1, wherein the transmitting the broadcast data packet to at least one receiving terminal in the local area network comprises: transmitting the broadcast data packet to at least one receiving terminal in the local area network by using a UDP protocol.
  9. 根据权利要求1所述的数据获取方法,其中,所述判断是否接收到所述接收终端反馈的确认信息,包括:判断预设时间内是否接收到所述接收终端反馈的确认信息。The data acquisition method according to claim 1, wherein the determining whether the confirmation information fed back by the receiving terminal is received comprises: determining whether the confirmation information fed back by the receiving terminal is received within a preset time.
  10. 一种数据获取装置,其包括:A data acquisition device includes:
    标识获取单元,用于若检测到数据获取指令,获取待获取数据的标识信息;An identifier obtaining unit, configured to acquire identification information of the data to be acquired if the data acquisition instruction is detected;
    生成单元,用于根据所述待获取数据的标识信息生成广播数据包;a generating unit, configured to generate a broadcast data packet according to the identifier information of the to-be-obtained data;
    发送单元,用于向局域网内至少一个接收终端发送所述广播数据包;a sending unit, configured to send the broadcast data packet to at least one receiving terminal in the local area network;
    判断单元,用于判断是否接收到所述接收终端反馈的确认信息,其中,所述确认信息为所述接收终端在接收到所述广播数据包后,根据所述待获取数据的标识信息查找到对应的待获取数据时生成的反馈信息;a determining unit, configured to determine whether the acknowledgment information fed back by the receiving terminal is received, where the acknowledgment information is that the receiving terminal, after receiving the broadcast data packet, finds the identifier information according to the to-be-obtained data Corresponding feedback information generated when data is to be acquired;
    数据获取单元,用于若接收到所述接收终端反馈的确认信息,根据所述确认信息获取所述待获取数据。The data obtaining unit is configured to obtain the acknowledgement information fed back by the receiving terminal, and acquire the to-be-obtained data according to the confirmation information.
  11. 根据权利要求10所述的数据获取装置,其中,所述待获取数据包括多个数据块;所述确认信息包括所述接收终端中已存储数据块的标识信息和未存储数据块的标识信息;The data obtaining apparatus according to claim 10, wherein the data to be acquired includes a plurality of data blocks; the confirmation information includes identification information of the stored data blocks in the receiving terminal and identification information of the unstored data blocks;
    所述数据获取单元,具体用于根据所述已存储数据块的标识信息从所述接收终端获取对应的数据块;以及根据所述未存储数据块的标识信息从所述服务器获取对应的数据块以完成获取所述待获取数据。The data acquiring unit is configured to acquire a corresponding data block from the receiving terminal according to the identifier information of the stored data block, and acquire a corresponding data block from the server according to the identifier information of the unstored data block. The obtaining of the to-be-obtained data is completed.
  12. 根据权利要求10所述的数据获取装置,其中,所述数据获取单元,具 体用于根据所述确认信息从所述接收终端获取所述待获取数据。The data acquisition device according to claim 10, wherein the data acquisition unit is configured to acquire the data to be acquired from the receiving terminal according to the confirmation information.
  13. 一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现:若检测到数据获取指令,获取待获取数据的标识信息;根据所述待获取数据的标识信息生成广播数据包;向局域网内至少一个接收终端发送所述广播数据包;判断是否接收到所述接收终端反馈的确认信息,其中,所述确认信息为所述接收终端在接收到所述广播数据包后,根据所述待获取数据的标识信息查找到对应的待获取数据时生成的反馈信息;若接收到所述接收终端反馈的确认信息,根据所述确认信息获取所述待获取数据。A computer device comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein the processor executes the computer program: if a data acquisition instruction is detected Obtaining identification information of the data to be acquired; generating a broadcast data packet according to the identification information of the data to be acquired; transmitting the broadcast data packet to at least one receiving terminal in the local area network; determining whether the confirmation information fed back by the receiving terminal is received, The confirmation information is feedback information generated when the receiving terminal searches for the corresponding data to be acquired according to the identification information of the data to be acquired after receiving the broadcast data packet; if the receiving terminal is received The feedback confirmation information is obtained according to the confirmation information.
  14. 根据权利要求13所述的计算机设备,其中,所述待获取数据包括多个数据块;所述确认信息包括所述接收终端中已存储数据块的标识信息和未存储数据块的标识信息;所述处理器执行所述计算机程序以实现根据所述确认信息获取所述待获取数据时,具体实现:根据所述已存储数据块的标识信息从所述接收终端获取对应的数据块;以及根据所述未存储数据块的标识信息从所述服务器获取对应的数据块以完成获取所述待获取数据。The computer device according to claim 13, wherein the data to be acquired comprises a plurality of data blocks; the confirmation information comprises identification information of stored data blocks in the receiving terminal and identification information of unstored data blocks; When the processor executes the computer program to obtain the data to be acquired according to the confirmation information, the specific implementation is: acquiring a corresponding data block from the receiving terminal according to the identification information of the stored data block; The identification information of the unstored data block is obtained from the server to obtain the data block to be acquired.
  15. 根据权利要求13所述的计算机设备,其中,所述处理器执行所述计算机程序以实现根据所述确认信息获取所述待获取数据时,具体实现:根据所述确认信息从所述接收终端获取所述待获取数据。The computer device according to claim 13, wherein the processor executes the computer program to obtain the data to be acquired according to the confirmation information, and is specifically implemented to: acquire from the receiving terminal according to the confirmation information. The data to be acquired.
  16. 根据权利要求13所述的计算机设备,其中,所述处理器执行所述计算机程序以实现根据所述待获取数据的标识信息生成广播数据包时,具体实现:获取所述局域网内所有所述接收终端的互联网协议地址;对所述局域网内所有所述互联网协议地址进行筛选以获得在线的互联网协议地址;以及根据所述待获取数据的标识信息和在线的互联网协议地址生成广播数据包。The computer device according to claim 13, wherein the processor executes the computer program to generate a broadcast data packet according to the identification information of the data to be acquired, and specifically implements: acquiring all the receiving in the local area network An internet protocol address of the terminal; screening all the internet protocol addresses in the local area network to obtain an online internet protocol address; and generating a broadcast data packet according to the identification information of the data to be acquired and the online internet protocol address.
  17. 一种存储介质,其中,所述存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行:若检测到数据获取指令,获取待获取数据的标识信息;根据所述待获取数据的标识信息生成广播数据包;向局域网内至少一个接收终端发送所述广播数据包;判断是否接收到所述接收终端反馈的确认信息,其中,所述确认信息为所述接收终端在接收到所述广播数据包后,根据所述待获取数据的标识信息查找到对应的待获取数据时生成的反馈信息;若接收到所述接收终端反馈的确认信息,根据 所述确认信息获取所述待获取数据。A storage medium, wherein the storage medium stores a computer program, the computer program comprising program instructions that, when executed by a processor, cause the processor to execute: if a data acquisition instruction is detected, obtaining Obtaining identification information of the data; generating a broadcast data packet according to the identification information of the data to be acquired; transmitting the broadcast data packet to at least one receiving terminal in the local area network; determining whether the confirmation information fed back by the receiving terminal is received, where The confirmation information is feedback information generated when the receiving terminal searches for the corresponding data to be acquired according to the identification information of the data to be acquired after receiving the broadcast data packet; if the feedback received by the receiving terminal is received And acquiring information to be acquired according to the confirmation information.
  18. 根据权利要求17所述的存储介质,其中,所述待获取数据包括多个数据块;所述确认信息包括所述接收终端中已存储数据块的标识信息和未存储数据块的标识信息;所述程序指令当被处理器执行以使所述处理器执行根据所述确认信息获取所述待获取数据时,具体执行:根据所述已存储数据块的标识信息从所述接收终端获取对应的数据块;以及根据所述未存储数据块的标识信息从所述服务器获取对应的数据块以完成获取所述待获取数据。The storage medium according to claim 17, wherein the data to be acquired includes a plurality of data blocks; the confirmation information includes identification information of the stored data blocks in the receiving terminal and identification information of the unstored data blocks; When the program instruction is executed by the processor to cause the processor to perform the acquiring the data to be acquired according to the confirmation information, specifically executing: acquiring corresponding data from the receiving terminal according to the identification information of the stored data block. And acquiring the corresponding data block from the server according to the identifier information of the unstored data block to complete acquiring the to-be-obtained data.
  19. 根据权利要求17所述的存储介质,其中,所述程序指令当被处理器执行以使所述处理器执行根据所述确认信息获取所述待获取数据时,具体执行:根据所述确认信息从所述接收终端获取所述待获取数据。The storage medium according to claim 17, wherein the program instructions, when executed by the processor to cause the processor to execute the acquiring data to be acquired according to the confirmation information, are specifically executed: according to the confirmation information The receiving terminal acquires the data to be acquired.
  20. 根据权利要求17所述的存储介质,其中,所述程序指令当被处理器执行以使所述处理器执行根据所述待获取数据的标识信息生成广播数据包时,具体执行:获取所述局域网内所有所述接收终端的互联网协议地址;对所述局域网内所有所述互联网协议地址进行筛选以获得在线的互联网协议地址;以及根据所述待获取数据的标识信息和在线的互联网协议地址生成广播数据包。The storage medium according to claim 17, wherein the program instructions, when executed by the processor to cause the processor to generate a broadcast data packet according to the identification information of the data to be acquired, specifically perform: acquiring the local area network An internet protocol address of all the receiving terminals; screening all the internet protocol addresses in the local area network to obtain an online internet protocol address; and generating a broadcast according to the identification information of the data to be acquired and an online internet protocol address data pack.
PCT/CN2018/075044 2017-11-13 2018-02-02 Data acquisition method and device, computer device and storage medium WO2019090997A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711113536.4A CN107682125A (en) 2017-11-13 2017-11-13 A kind of data capture method, device, computer equipment and storage medium
CN201711113536.4 2017-11-13

Publications (1)

Publication Number Publication Date
WO2019090997A1 true WO2019090997A1 (en) 2019-05-16

Family

ID=61146972

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/075044 WO2019090997A1 (en) 2017-11-13 2018-02-02 Data acquisition method and device, computer device and storage medium

Country Status (2)

Country Link
CN (1) CN107682125A (en)
WO (1) WO2019090997A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112417022A (en) * 2020-11-27 2021-02-26 深圳市金证科技股份有限公司 Method, device, terminal and storage medium for acquiring data
CN114724297A (en) * 2020-12-22 2022-07-08 深圳Tcl新技术有限公司 Queuing method, queuing device, terminal equipment and computer readable storage medium
CN112417022B (en) * 2020-11-27 2024-06-07 深圳市金证科技股份有限公司 Method, device, terminal and storage medium for acquiring data

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111200834B (en) * 2018-11-20 2022-12-02 深圳长城开发科技股份有限公司 Communication method, terminal, server, and computer storage medium
CN109799722A (en) * 2019-02-18 2019-05-24 珠海格力电器股份有限公司 Control method, device, system and the storage medium of smart home system, equipment
CN109816387A (en) * 2019-03-02 2019-05-28 杭州复杂美科技有限公司 Data transmission method, equipment and storage medium
CN110460156A (en) * 2019-08-15 2019-11-15 北京嘉士宝科技有限公司 Instruct transmission method, device and storage medium
CN113490154B (en) * 2021-07-01 2022-05-17 深圳市恒扬数据股份有限公司 Broadcast data transmission method, device, terminal equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101127623A (en) * 2007-09-27 2008-02-20 腾讯科技(深圳)有限公司 Data processing method, device and system
CN104104728A (en) * 2014-07-23 2014-10-15 小米科技有限责任公司 Data transmission method and device
CN106357728A (en) * 2016-08-25 2017-01-25 广州小百合信息技术有限公司 Message processing method, system and terminal
CN106899641A (en) * 2015-12-21 2017-06-27 北京奇虎科技有限公司 The acquisition methods of data resource, server, control device and communication system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101355588B (en) * 2008-09-08 2012-08-01 创新科存储技术(深圳)有限公司 Data transmission method and transmission terminal base on peer-to-peer network
CN104836822B (en) * 2014-02-10 2019-04-26 腾讯科技(深圳)有限公司 Obtain downloading data method and device, the method and system of downloading data
CN104580441A (en) * 2014-12-30 2015-04-29 北京奇虎科技有限公司 Data distribution method in local area network, server and terminal device
CN106899640A (en) * 2015-12-21 2017-06-27 北京奇虎科技有限公司 The acquisition methods and communication system of data resource

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101127623A (en) * 2007-09-27 2008-02-20 腾讯科技(深圳)有限公司 Data processing method, device and system
CN104104728A (en) * 2014-07-23 2014-10-15 小米科技有限责任公司 Data transmission method and device
CN106899641A (en) * 2015-12-21 2017-06-27 北京奇虎科技有限公司 The acquisition methods of data resource, server, control device and communication system
CN106357728A (en) * 2016-08-25 2017-01-25 广州小百合信息技术有限公司 Message processing method, system and terminal

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112417022A (en) * 2020-11-27 2021-02-26 深圳市金证科技股份有限公司 Method, device, terminal and storage medium for acquiring data
CN112417022B (en) * 2020-11-27 2024-06-07 深圳市金证科技股份有限公司 Method, device, terminal and storage medium for acquiring data
CN114724297A (en) * 2020-12-22 2022-07-08 深圳Tcl新技术有限公司 Queuing method, queuing device, terminal equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN107682125A (en) 2018-02-09

Similar Documents

Publication Publication Date Title
WO2019090997A1 (en) Data acquisition method and device, computer device and storage medium
US10652331B1 (en) Locally providing highly available cloud-based storage system services
JP5872731B2 (en) Computer implemented method, non-transitory computer readable medium and computer system for communicating detection of link failure to each of a plurality of nodes of a cluster
JP6091724B2 (en) Link health check method and apparatus
US9979670B2 (en) Method for providing a connection of a client to an unmanaged service in a client-server remote access system
US8769089B2 (en) Distributed application using diagnostic heartbeating
US9244796B2 (en) Diagnostic heartbeat throttling
US8903893B2 (en) Diagnostic heartbeating in a distributed data processing environment
US10491632B1 (en) Methods for reducing compliance violations in mobile application management environments and devices thereof
US20130124912A1 (en) Synchronizing a distributed communication system using diagnostic heartbeating
US20130124911A1 (en) Communication system with diagnostic capabilities
US8352729B2 (en) Secure application routing
US8037289B1 (en) Method and apparatus for cloning a configuration of a computer in a data center
US20170126789A1 (en) Automatic Software Controller Configuration based on Application and Network Data
US11245589B2 (en) IoT topology analyzer defining an IoT topology and associated methods
CN112929225B (en) Session exception handling method and device, computer equipment and storage medium
US10594584B2 (en) Network analysis and monitoring tool
US10218820B2 (en) Method and apparatus for processing data packet based on parallel protocol stack instances
US11736500B2 (en) System and method for device quarantine management
US7966524B2 (en) Systems and methods for gathering and selectively synchronizing state information of at least one machine
WO2019119269A1 (en) Network fault detection method and control center device
JP7147065B2 (en) Simultaneous testing of correct handling of exceptions by multiple electronic devices connected via a communication network
US11271985B2 (en) Method and network node for handling SCTP packets
GB2515637A (en) Apparatus, systems, and methods for providing policy in network-based applications
US11507391B1 (en) Network initialization monitoring system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18876660

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 14/08/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18876660

Country of ref document: EP

Kind code of ref document: A1