[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN114844849A - Data transmission method and device, electronic equipment and storage medium - Google Patents

Data transmission method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114844849A
CN114844849A CN202210335407.4A CN202210335407A CN114844849A CN 114844849 A CN114844849 A CN 114844849A CN 202210335407 A CN202210335407 A CN 202210335407A CN 114844849 A CN114844849 A CN 114844849A
Authority
CN
China
Prior art keywords
terminal
data
sending
local area
network
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210335407.4A
Other languages
Chinese (zh)
Inventor
王思颖
彭飞
邓竹立
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Chengshi Wanglin Information Technology Co Ltd
Original Assignee
Beijing Chengshi Wanglin Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Chengshi Wanglin Information Technology Co Ltd filed Critical Beijing Chengshi Wanglin Information Technology Co Ltd
Priority to CN202210335407.4A priority Critical patent/CN114844849A/en
Publication of CN114844849A publication Critical patent/CN114844849A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention provides a data transmission method, a data transmission device, electronic equipment and a storage medium, wherein the method is applied to a sending terminal, the sending terminal can acquire the network information to which the sending terminal belongs currently, and respond to the data sharing instruction input by the user in the application program, searching a receiving terminal which belongs to a local area network with the sending terminal according to the network information, if the receiving terminal which belongs to the local area network with the sending terminal exists, the target data corresponding to the data sharing instruction may be determined, and the target data may be transmitted to the receiving terminal, so that when a user initiates data sharing in an application, a terminal can share data by looking up other terminals located in the same local area network, and sending the shared data to them, under the condition of running the same application program, the terminals based on the same local area network can avoid constructing a user relationship for data sharing, and effectively reduce the threshold of data sharing.

Description

数据传输方法、装置、电子设备及存储介质Data transmission method, device, electronic device and storage medium

技术领域technical field

本发明涉及数据处理技术领域,特别是涉及一种数据传输方法、一种数据传输装置、一种电子设备以及一种计算机可读存储介质。The present invention relates to the technical field of data processing, and in particular, to a data transmission method, a data transmission device, an electronic device and a computer-readable storage medium.

背景技术Background technique

网络时代,资源共享是一个非常重要的概念。不同设备、不同用户终端、不同应用等可以通过网络进行数据共享,通过数据共享,同一个用户可以在不同设备之间进行数据共享,不同用户可以在不同的设备之间进行数据共享,有效地促进了数据的流通。其中,在相关的数据传输场景中,数据的发送方与接收方之间需要建立用户关系才能实现,然而基于用户关系的数据共享限制了数据共享双方的数据传输,大大增加了数据共享的门槛。In the network age, resource sharing is a very important concept. Different devices, different user terminals, and different applications can share data through the network. Through data sharing, the same user can share data between different devices, and different users can share data between different devices, effectively promoting the flow of data. Among them, in the relevant data transmission scenario, a user relationship needs to be established between the sender and the receiver of the data. However, data sharing based on the user relationship limits the data transmission between the data sharing parties and greatly increases the threshold for data sharing.

发明内容SUMMARY OF THE INVENTION

本发明实施例是提供一种数据传输方法、装置、电子设备以及计算机可读存储介质,以解决或部分解决数据共享过程中存在用户限制以及传输门槛的问题。Embodiments of the present invention provide a data transmission method, apparatus, electronic device, and computer-readable storage medium to solve or partially solve the problems of user restrictions and transmission thresholds in the process of data sharing.

本发明实施例公开了一种数据传输方法,应用于发送终端,所述方法包括:An embodiment of the present invention discloses a data transmission method, which is applied to a sending terminal, and the method includes:

获取所述发送终端的网络信息;acquiring network information of the sending terminal;

响应于应用程序内的数据共享指令,根据所述网络信息查找与所述发送终端同属一个局域网的接收终端;In response to the data sharing instruction in the application, search for a receiving terminal that belongs to the same local area network as the sending terminal according to the network information;

若存在与所述发送终端同属一个局域网的接收终端,则确定与所述数据共享指令对应的目标数据,并将所述目标数据发送至所述接收终端。If there is a receiving terminal that belongs to the same local area network as the sending terminal, the target data corresponding to the data sharing instruction is determined, and the target data is sent to the receiving terminal.

可选地,所述网络信息至少包括所述发送终端的子网掩码,所述根据所述网络信息查找与所述发送终端同属一个局域网的接收终端,包括:Optionally, the network information includes at least the subnet mask of the sending terminal, and the searching for a receiving terminal that belongs to the same local area network as the sending terminal according to the network information includes:

采用所述子网掩码,查找与所述发送终端同属一个局域网的接收终端。Using the subnet mask, search for a receiving terminal that belongs to the same local area network as the sending terminal.

可选地,所述网络信息还包括所述发送终端的第一IP地址,所述采用所述子网掩码,查找与所述发送终端同属一个局域网的接收终端,包括:Optionally, the network information further includes the first IP address of the sending terminal, and using the subnet mask to search for a receiving terminal that belongs to the same local area network as the sending terminal, including:

查找与所述子网掩码相同的至少一个目标终端,并获取各个所述目标终端的第二IP地址;Find at least one target terminal with the same subnet mask, and obtain the second IP address of each of the target terminals;

采用所述第一IP地址与所述子网掩码,计算所述发送终端的第一网络地址,以及采用所述第二IP地址与所述第一子网掩码,计算所述目标终端的第二网络地址;Use the first IP address and the subnet mask to calculate the first network address of the sending terminal, and use the second IP address and the first subnet mask to calculate the target terminal's the second network address;

将与所述第一网络地址相同的第二网络地址对应的目标终端作为与所述发送终端同属一个局域网的接收终端。A target terminal corresponding to a second network address that is the same as the first network address is used as a receiving terminal that belongs to the same local area network as the sending terminal.

可选地,还包括:Optionally, also include:

若不存在与所述第一网络地址相同的第二网络地址,则显示针对所述目标终端的第一提示信息,所述第一提示信息为各个所述目标终端与所述发送终端不处于同一个局域网的信息。If there is no second network address that is the same as the first network address, first prompt information for the target terminal is displayed, and the first prompt information is that each of the target terminals is not in the same location as the sending terminal. information on a local area network.

可选地,所述将所述目标数据发送至所述接收终端,包括:Optionally, the sending the target data to the receiving terminal includes:

将所述目标数据发送至预设服务端,通过所述服务端将所述目标数据发发送至所述接收终端,以使所述接收终端响应数据接收请求,并对所述目标数据进行接收。The target data is sent to a preset server, and the server sends the target data to the receiving terminal, so that the receiving terminal responds to the data receiving request and receives the target data.

可选地,还包括:Optionally, also include:

若不存在与所述发送终端同属一个局域网的接收终端,则显示针对所述数据共享指令的第二提示信息,所述第二提示信息为不存在与所述发送终端同属一个局域网的终端的信息。If there is no receiving terminal that belongs to the same local area network as the sending terminal, second prompt information for the data sharing instruction is displayed, and the second prompt information is information that there is no terminal that belongs to the same local area network as the sending terminal. .

可选地,所述目标数据至少包括图片、音频、视频、文档、帖子中的一种。Optionally, the target data includes at least one of pictures, audios, videos, documents, and posts.

本发明实施例还公开了一种数据传输装置,应用于发送终端,所述装置包括:The embodiment of the present invention also discloses a data transmission device, which is applied to a sending terminal, and the device includes:

网络信息获取模块,用于获取所述发送终端的网络信息;a network information acquisition module, configured to acquire the network information of the sending terminal;

接收终端查找模块,用于响应于应用程序内的数据共享指令,根据所述网络信息查找与所述发送终端同属一个局域网的接收终端;a receiving terminal search module, configured to search for a receiving terminal that belongs to the same local area network as the sending terminal according to the network information in response to a data sharing instruction in the application;

数据发送模块,用于若存在与所述发送终端同属一个局域网的接收终端,则确定与所述数据共享指令对应的目标数据,并将所述目标数据发送至所述接收终端。The data sending module is configured to determine target data corresponding to the data sharing instruction if there is a receiving terminal belonging to the same local area network as the sending terminal, and send the target data to the receiving terminal.

可选地,所述网络信息至少包括所述发送终端的子网掩码,所述接收终端查找模块具体用于:Optionally, the network information includes at least the subnet mask of the sending terminal, and the receiving terminal searching module is specifically configured to:

采用所述子网掩码,查找与所述发送终端同属一个局域网的接收终端。Using the subnet mask, search for a receiving terminal that belongs to the same local area network as the sending terminal.

可选地,所述网络信息还包括所述发送终端的第一IP地址,所述接收终端查找模块具体用于:Optionally, the network information further includes the first IP address of the sending terminal, and the receiving terminal searching module is specifically configured to:

查找与所述子网掩码相同的至少一个目标终端,并获取各个所述目标终端的第二IP地址;Find at least one target terminal with the same subnet mask, and obtain the second IP address of each of the target terminals;

采用所述第一IP地址与所述子网掩码,计算所述发送终端的第一网络地址,以及采用所述第二IP地址与所述第一子网掩码,计算所述目标终端的第二网络地址;Use the first IP address and the subnet mask to calculate the first network address of the sending terminal, and use the second IP address and the first subnet mask to calculate the target terminal's the second network address;

将与所述第一网络地址相同的第二网络地址对应的目标终端作为与所述发送终端同属一个局域网的接收终端。A target terminal corresponding to a second network address that is the same as the first network address is used as a receiving terminal that belongs to the same local area network as the sending terminal.

可选地,还包括:Optionally, also include:

第一提示信息显示模块,用于若不存在与所述第一网络地址相同的第二网络地址,则显示针对所述目标终端的第一提示信息,所述第一提示信息为各个所述目标终端与所述发送终端不处于同一个局域网的信息。A first prompt information display module, configured to display first prompt information for the target terminal if there is no second network address that is the same as the first network address, the first prompt information for each of the targets Information that the terminal and the sending terminal are not in the same local area network.

可选地,所述数据发送模块具体用于:Optionally, the data sending module is specifically used for:

将所述目标数据发送至预设服务端,通过所述服务端将所述目标数据发发送至所述接收终端,以使所述接收终端响应数据接收请求,并对所述目标数据进行接收。The target data is sent to a preset server, and the server sends the target data to the receiving terminal, so that the receiving terminal responds to the data receiving request and receives the target data.

可选地,还包括:Optionally, also include:

第二提示信息显示模块,用于若不存在与所述发送终端同属一个局域网的接收终端,则显示针对所述数据共享指令的第二提示信息,所述第二提示信息为不存在与所述发送终端同属一个局域网的终端的信息。The second prompt information display module is configured to display second prompt information for the data sharing instruction if there is no receiving terminal that belongs to the same local area network as the sending terminal, where the second prompt information is that there is no receiving terminal that belongs to the same local area network as the sending terminal. Send the information of the terminals that belong to the same local area network.

可选地,所述目标数据至少包括图片、音频、视频、文档、帖子中的一种。Optionally, the target data includes at least one of pictures, audios, videos, documents, and posts.

本发明实施例还公开了一种电子设备,包括处理器、通信接口、存储器和通信总线,其中,所述处理器、所述通信接口以及所述存储器通过所述通信总线完成相互间的通信;An embodiment of the present invention further discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

所述存储器,用于存放计算机程序;the memory for storing computer programs;

所述处理器,用于执行存储器上所存放的程序时,实现如本发明实施例所述的方法。The processor is configured to implement the method according to the embodiment of the present invention when executing the program stored in the memory.

本发明实施例还公开了一种计算机可读存储介质,其上存储有指令,当由一个或多个处理器执行时,使得所述处理器执行如本发明实施例所述的方法。The embodiment of the present invention also discloses a computer-readable storage medium, on which instructions are stored, and when executed by one or more processors, cause the processors to execute the method according to the embodiment of the present invention.

本发明实施例包括以下优点:The embodiments of the present invention include the following advantages:

在本发明实施例中,可以应用于发送终端,则发送终端可以获取当前所属的网络信息,并响应用户在应用程序内输入的数据共享指令,根据网络信息查找与发送终端同属一个局域网的接收终端,若存在与发送终端同属一个局域网的接收终端,则可以确定与数据共享指令对应的目标数据,并将目标数据发送至接收终端,从而当用户在应用程序中发起数据共享时,终端可以通过查找位于同一局域网的其他终端,并向其发送共享数据,在运行同一应用程序的情况下,基于同一局域网的终端可以避免构建用户关系进行数据共享,有效地降低了数据共享的门槛。In this embodiment of the present invention, it can be applied to a sending terminal, and the sending terminal can obtain the network information to which it currently belongs, and respond to the data sharing instruction input by the user in the application program, and search for the receiving terminal that belongs to the same local area network as the sending terminal according to the network information. , if there is a receiving terminal that belongs to the same local area network as the sending terminal, the target data corresponding to the data sharing instruction can be determined, and the target data can be sent to the receiving terminal, so that when the user initiates data sharing in the application, the terminal can search for Other terminals located in the same local area network send shared data to them. In the case of running the same application, terminals based on the same local area network can avoid building user relationships for data sharing, effectively lowering the threshold for data sharing.

附图说明Description of drawings

图1是本发明实施例中提供的一种数据传输方法的步骤流程图;1 is a flow chart of steps of a data transmission method provided in an embodiment of the present invention;

图2是本发明实施例中提供的数据共享的流程示意图;2 is a schematic flowchart of data sharing provided in an embodiment of the present invention;

图3是本发明实施例中提供的一种数据传输装置的结构框图;3 is a structural block diagram of a data transmission apparatus provided in an embodiment of the present invention;

图4是本发明实施例中提供的一种电子设备的框图;4 is a block diagram of an electronic device provided in an embodiment of the present invention;

图5是本发明实施例中提供的一种计算机可读介质的示意图。FIG. 5 is a schematic diagram of a computer-readable medium provided in an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。In order to make the above objects, features and advantages of the present invention more clearly understood, the present invention will be described in further detail below with reference to the accompanying drawings and specific embodiments.

局域网可以为一种网络种类,其覆盖范围一般可以是方圆几千米之内,其具备的安装便捷、成本节约、扩展方便等特点使其在各类办公室内运用广泛。局域网可以实现文件管理、应用软件共享、打印机共享等功能,在使用过程中,通过维护局域网网络安全,能够有效的保护资料安全,保证局域网网络能够正常稳定的运行。数据共享就是让在不同地方使用不同计算机、不同软件的用户能够读取他人数据并进行各种操作、运算和分析。A local area network can be a type of network, and its coverage can generally be within a few kilometers. It has the characteristics of convenient installation, cost saving, and easy expansion, which makes it widely used in various offices. The local area network can realize functions such as file management, application software sharing, printer sharing, etc. In the process of use, by maintaining the security of the local area network network, it can effectively protect the security of data and ensure the normal and stable operation of the local area network network. Data sharing is to allow users who use different computers and different software in different places to read other people's data and perform various operations, calculations and analysis.

作为一种示例,在相关技术中,人们对于数据共享的需求越来越高,但是由于用户之间没有建立对应的身份关系,导致数据分享传输的方式很复杂。例如,发送方与接收方需要以登录为前提,通过构建发送方与接收方之间的用户关系,然后使用即时通讯功能进行消息的发送,实现数据共享。或者跳出当前App,使用其他建立用户关系的App进行数据传输的通信。由此可见,在上述过程中,基于用户关系的数据共享限制了数据共享双方的数据传输,大大增加了数据共享的门槛。As an example, in the related art, people's demands for data sharing are getting higher and higher, but since there is no corresponding identity relationship established between users, the manner of data sharing and transmission is very complicated. For example, the sender and the receiver need to log in as the premise, build a user relationship between the sender and the receiver, and then use the instant messaging function to send messages to achieve data sharing. Or jump out of the current app and use other apps that establish user relationships for data transmission communication. It can be seen that, in the above process, the data sharing based on the user relationship limits the data transmission between the data sharing parties and greatly increases the threshold for data sharing.

对此,本发明的核心发明点之一在于针对发送终端,其可以响应于用户在应用程序中输入的数据共享指令,根据用户授权后获取的当前所属的网络信息查找与自身同属一个局域网的接收终端,若存在与自身同属一个局域网的接收终端,则可以确定与数据共享指令对应的目标数据,并将目标数据发送至接收终端,从而当用户在应用程序中发起数据共享时,终端可以通过查找位于同一局域网的其他终端,并向其发送共享数据,在运行同一应用程序的情况下,基于同一局域网的终端可以避免构建用户关系进行数据共享,有效地降低了数据共享的门槛。In this regard, one of the core inventive points of the present invention is that for the sending terminal, it can respond to the data sharing instruction input by the user in the application program, according to the current network information obtained after the user's authorization, to search for the receiving terminal that belongs to the same local area network as itself. The terminal, if there is a receiving terminal that belongs to the same local area network as itself, can determine the target data corresponding to the data sharing instruction, and send the target data to the receiving terminal, so that when the user initiates data sharing in the application, the terminal can search for the target data. Other terminals located in the same local area network send shared data to them. In the case of running the same application, terminals based on the same local area network can avoid building user relationships for data sharing, effectively lowering the threshold for data sharing.

具体的,参照图1,示出了本发明实施例中提供的一种数据传输方法的步骤流程图,应用于发送终端,具体可以包括如下步骤:Specifically, referring to FIG. 1, it shows a flowchart of steps of a data transmission method provided in an embodiment of the present invention, which is applied to a sending terminal, and may specifically include the following steps:

步骤101,获取所述发送终端的网络信息;Step 101, acquiring network information of the sending terminal;

对于发送终端与接收终端,其可以包括台式电脑、笔记本电脑、平板电脑以及移动终端等用户终端,在用户终端中可以运行对应的应用程序,应用程序可以包括生活类应用程序、音频应用程序、游戏应用程序以及求职应用程序等,则在发送终端与接收终端之间运行同一个应用程序的过程中,发送终端可以发起数据共享,并在满足条件的情况下,将共享数据发送至接收终端。For the sending terminal and the receiving terminal, it may include user terminals such as desktop computers, notebook computers, tablet computers, and mobile terminals, and corresponding application programs can be run in the user terminals, and the application programs may include life applications, audio applications, games In the process of running the same application between the sending terminal and the receiving terminal, the sending terminal can initiate data sharing, and if the conditions are met, send the shared data to the receiving terminal.

在具体实现中,终端可以在运行相应应用程序的过程中,应用程序可以对终端所属网络的网络信息进行获取,以便根据网络信息进行数据共享。需要说明的是,本发明实施例中所提出的关于网络信息的获取动作是在遵照所在地国家相应的数据保护法规政策的前提下,并获得由相应装置所有者给予授权的情况下进行的。In a specific implementation, in the process of running a corresponding application program on the terminal, the application program may acquire network information of the network to which the terminal belongs, so as to perform data sharing according to the network information. It should be noted that the acquisition of network information proposed in the embodiments of the present invention is performed under the premise of complying with the corresponding data protection regulations and policies of the local country and authorized by the corresponding device owner.

步骤102,响应于应用程序内的数据共享指令,根据所述网络信息查找与所述发送终端同属一个局域网的接收终端;Step 102, in response to the data sharing instruction in the application, search for a receiving terminal that belongs to the same local area network as the sending terminal according to the network information;

发送终端在运行应用程序的过程中,当用户需要进行数据共享时,其可以为应用程序内输入对应的数据共享指令,接着终端可以响应于应用程序内的数据共享指令,并根据用户授权后获取的当前所属的网络信息查找与发誓发送终端同属一个局域网的接收终端,以便向其发送数据。When the sending terminal is running the application, when the user needs to share data, it can input the corresponding data sharing instruction in the application, and then the terminal can respond to the data sharing instruction in the application, and obtain the data according to the authorization of the user. Search for the receiving terminal that belongs to the same local area network as the swearing sending terminal, so as to send data to it.

其中,网络信息可以包括发送终端的子网掩码,子网掩码可以用于指明一个IP地址的哪些位标识的是终端所在的子网以及哪些位标识的是终端的位掩码,其通过与IP地址进行结合,可以确定终端的网络地址。可选地,子网掩码可以为一个32位地址,用于屏蔽IP地址的一部分以区别网络标识和终端标识,并说明该IP地址是在局域网上,还是在广域网上。The network information may include the subnet mask of the sending terminal, and the subnet mask may be used to indicate which bits of an IP address identify the subnet where the terminal is located and which bits identify the bit mask of the terminal. Combined with the IP address, the network address of the terminal can be determined. Optionally, the subnet mask may be a 32-bit address, which is used to mask a part of the IP address to distinguish the network identifier from the terminal identifier, and to indicate whether the IP address is on the local area network or the wide area network.

在具体实现中,用户在处理相关数据的过程中,当需要将相关数据共享至另一终端时,可以通过在应用程序中提供的分享路径对数据进行共享,则发送终端可以响应于应用程序内的数据共享指令,展示对应的终端查找界面,并通过在先获取的发送终端的子网掩码,查找与发送终端同属一个局域网内的接收终端,以便向其发送对应的数据。In a specific implementation, in the process of processing related data, when the user needs to share the related data to another terminal, the data can be shared through the sharing path provided in the application program, and the sending terminal can respond to the in-application program. It displays the corresponding terminal search interface, and searches for the receiving terminal that belongs to the same local area network as the sending terminal through the subnet mask of the sending terminal obtained earlier, so as to send the corresponding data to it.

具体的,网络信息还可以包括发送终端的第一IP地址,则发送终端可以先查找与发送终端的子网掩码相同的至少一个目标终端,若查找到与子网掩码相同的至少一个目标终端,则可以进一步获取各个目标终端的第二IP地址,接着发送终端可以采用第一IP地址与子网掩码,计算发送终端的第一网络地址,以及采用第二IP地址与第一子网掩码,计算目标终端的第二网络地址,然后将各个目标终端的第二网络地址与发送终端的第一网络地址进行比对,并将与第一网络地址相同的第二网络地址对应的目标终端作为与发送终端同属一个局域网的接收终端。Specifically, the network information may also include the first IP address of the sending terminal, and the sending terminal may first search for at least one target terminal with the same subnet mask as the sending terminal. If it finds at least one target terminal with the same subnet mask The terminal can further obtain the second IP address of each target terminal, and then the sending terminal can use the first IP address and the subnet mask to calculate the first network address of the sending terminal, and use the second IP address and the first subnet mask. mask, calculate the second network address of the target terminal, then compare the second network address of each target terminal with the first network address of the sending terminal, and assign the target corresponding to the second network address that is the same as the first network address The terminal acts as a receiving terminal that belongs to the same local area network as the sending terminal.

此外,若不存在与第一网络地址相同的第二网络地址,则显示针对目标终端的第二提示信息,第二提示信息为各个目标终端与发送终端不处于同一个局域网的信息。In addition, if there is no second network address that is the same as the first network address, second prompt information for the target terminal is displayed, and the second prompt information is information that each target terminal and the sending terminal are not in the same local area network.

可选地,子网掩码可以用于判定不同终端的IP地址是在局域网还是广域网上,IP地址可以用于表征终端唯一的地址,则通过子网掩码以及IP地址进行相与计算,可以得到终端的网络地址,若网络地址相同则可以表征不同终端位于同一个局域网,从而发送终端可以先通过子网掩码查找同样位于局域网的目标终端,然后根据子网掩码与IP地址的相与计算各个终端的网络地址,进而通过网络地址比对的方式筛选出与发送终端位于同一个局域网中的接收终端,以便向其发送对应的目标数据,从而当用户在应用程序中发起数据共享时,终端可以通过查找位于同一局域网的其他终端,并向其发送共享数据,在运行同一应用程序的情况下,基于同一局域网的终端可以避免构建用户关系进行数据共享,有效地降低了数据共享的门槛。Optionally, the subnet mask can be used to determine whether the IP addresses of different terminals are on a local area network or a wide area network, and the IP address can be used to represent the unique address of the terminal. Obtain the network address of the terminal. If the network address is the same, it can indicate that different terminals are located in the same local area network, so that the sending terminal can first search for the target terminal also located in the local area network through the subnet mask, and then according to the combination of the subnet mask and the IP address. Calculate the network address of each terminal, and then filter out the receiving terminal located in the same local area network as the sending terminal through network address comparison, so as to send the corresponding target data to it, so that when the user initiates data sharing in the application program, Terminals can search for other terminals in the same local area network and send shared data to them. In the case of running the same application, terminals based on the same local area network can avoid building user relationships for data sharing, effectively lowering the threshold for data sharing.

在一种可选实施例中,用户于应用程序中输入对应的数据共享指令时,终端可以先检测当前是否接入网络,并在接入网络的情况下,执行前述查找接收终端的过程;若终端未接入网络,则可以输出对应的提示信息,以提示用户先将终端接入网络,再进行数据共享。In an optional embodiment, when the user inputs the corresponding data sharing instruction in the application program, the terminal may first detect whether it is currently connected to the network, and in the case of accessing the network, perform the aforementioned process of searching for the receiving terminal; if If the terminal is not connected to the network, corresponding prompt information may be output to prompt the user to connect the terminal to the network first, and then perform data sharing.

步骤103,若存在与所述发送终端同属一个局域网的接收终端,则确定与所述数据共享指令对应的目标数据,并将所述目标数据发送至所述接收终端。Step 103: If there is a receiving terminal that belongs to the same local area network as the sending terminal, determine target data corresponding to the data sharing instruction, and send the target data to the receiving terminal.

在本发明实施例中,当发送终端通过自身的IP地址以及子网掩码查找到同属于一个局域网中的接收终端时,可以确定与数据共享指令对应的目标数据,然后将目标数据发送至接收终端。其中,目标数据至少可以包括图片、音频、视频、文档、帖子中的一种,从而当用户在应用程序中发起数据共享时,终端可以通过查找位于同一局域网的其他终端,并向其发送共享数据,在运行同一应用程序的情况下,基于同一局域网的终端可以避免构建用户关系进行数据共享,有效地降低了数据共享的门槛,同时在同一局域网中进行数据传输,可以有效保证数据传输的稳定性以及传输速度。In the embodiment of the present invention, when the sending terminal finds the receiving terminal that belongs to the same local area network through its own IP address and subnet mask, it can determine the target data corresponding to the data sharing instruction, and then send the target data to the receiving terminal. terminal. The target data may include at least one of pictures, audio, video, documents, and posts, so that when a user initiates data sharing in an application, the terminal can search for other terminals located in the same local area network and send the shared data to them. , In the case of running the same application, terminals based on the same local area network can avoid building user relationships for data sharing, effectively lowering the threshold for data sharing, and at the same time, data transmission in the same local area network can effectively ensure the stability of data transmission and transfer speed.

在具体实现中,发送终端在确定与数据共享指令对应的目标数据后,可以将目标数据发送至服务端,并通过服务端将目标数据发送至接收终端。接收终端在运行同一个应用程序的情况下,可以在接收到服务端发送的数据共享请求后,可以根据接收终端所属用户的用户操作(包括确认共享以及拒绝共享等操作)执行对应的数据处理,若用户确认共享,则接收终端可以响应于数据接收请求,并对目标数据进行接收,然后展示对应的目标数据;若用户拒绝共享,则服务端可以获取接收终端发送的回应消息,并将回应消息发送至发送终端,由发送终端展示回应消息,以告知所属用户共享数据失败。In a specific implementation, after determining the target data corresponding to the data sharing instruction, the sending terminal may send the target data to the server, and then send the target data to the receiving terminal through the server. When the receiving terminal is running the same application program, after receiving the data sharing request sent by the server, it can perform corresponding data processing according to the user operation of the user to which the receiving terminal belongs (including operations such as confirming sharing and refusing sharing), If the user confirms sharing, the receiving terminal can respond to the data receiving request, receive the target data, and then display the corresponding target data; if the user refuses to share, the server can obtain the response message sent by the receiving terminal, and send the response message It is sent to the sending terminal, and the sending terminal displays a response message to inform the user of the failure to share data.

此外,若发送终端根据自身的IP地址与子网掩码未查找到与发送终端同属一个局域网的接收终端,则可以显示针对数据共享指令的第一提示信息,第一提示信息为不存在与发送终端同属一个局域网的终端的信息,以告知所属用户附近不存在可进行数据共享的终端,从而通过上述过程,发送终端可以基于网络信息在同一个局域网中查找可进行数据共享的接收终端,避免了通过建立用户关系进行数据共享的方式,有效地降低了数据共享的门槛。In addition, if the sending terminal does not find a receiving terminal that belongs to the same local area network as the sending terminal according to its own IP address and subnet mask, it can display the first prompt information for the data sharing instruction, and the first prompt information is that it does not exist and is sent. The information of the terminals that belong to the same local area network to inform the user that there is no terminal that can share data nearby, so that through the above process, the sending terminal can search for the receiving terminal that can share data in the same local area network based on the network information, avoiding the need for data sharing. By establishing user relationships for data sharing, the threshold for data sharing is effectively lowered.

需要说明的是,本发明实施例包括但不限于上述示例,可以理解的是,本领域技术人员在本发明实施例的思想指导下,还可以根据实际需求进行设置,本发明对此不作限制。It should be noted that the embodiments of the present invention include, but are not limited to, the above examples. It can be understood that those skilled in the art can also make settings according to actual needs under the guidance of the embodiments of the present invention, which is not limited by the present invention.

在本发明实施例中,可以应用于发送终端,则发送终端可以获取当前所属的网络信息,并响应用户在应用程序内输入的数据共享指令,根据网络信息查找与发送终端同属一个局域网的接收终端,若存在与发送终端同属一个局域网的接收终端,则可以确定与数据共享指令对应的目标数据,并将目标数据发送至接收终端,从而当用户在应用程序中发起数据共享时,终端可以通过查找位于同一局域网的其他终端,并向其发送共享数据,在运行同一应用程序的情况下,基于同一局域网的终端可以避免构建用户关系进行数据共享,有效地降低了数据共享的门槛。In this embodiment of the present invention, it can be applied to a sending terminal, and the sending terminal can obtain the network information to which it currently belongs, and respond to the data sharing instruction input by the user in the application program, and search for the receiving terminal that belongs to the same local area network as the sending terminal according to the network information. , if there is a receiving terminal that belongs to the same local area network as the sending terminal, the target data corresponding to the data sharing instruction can be determined, and the target data can be sent to the receiving terminal, so that when the user initiates data sharing in the application, the terminal can search for Other terminals located in the same local area network send shared data to them. In the case of running the same application, terminals based on the same local area network can avoid building user relationships for data sharing, effectively lowering the threshold for data sharing.

为了是本领域技术人员更好地理解本发明实施例的技术方案,下面通过一个例子进行示例性说明:In order for those skilled in the art to better understand the technical solutions of the embodiments of the present invention, an example is illustrated below:

参照图2,示出了本发明实施例中提供的数据共享的流程示意图,针对发送终端以及接收终端所运行的同一个应用程序,可以在应用程序中配置一个网络监测功能,应用程序在提示并获取了用户授权后,可以在应用程序前台运行的过程中,通过网络监测功能对所属终端的网络进行监测,以便用户于应用程序中发起数据共享时,可以基于网络信息查找对应的接收终端进行数据共享。具体过程可以包括:Referring to FIG. 2 , a schematic flowchart of data sharing provided in an embodiment of the present invention is shown. For the same application program run by the sending terminal and the receiving terminal, a network monitoring function can be configured in the application program. After obtaining user authorization, the network monitoring function of the terminal can be used to monitor the network of the terminal when the application is running in the foreground, so that when the user initiates data sharing in the application, the corresponding receiving terminal can be searched for data based on the network information. shared. Specific processes can include:

1、应用程序可以实时对所属终端进行网络监测,当网络产生变化时实时上传当前网络的IP地址以及子网掩码等相关数据至服务端,以便用于后期功能校验使用。1. The application can monitor the network of the terminal it belongs to in real time. When the network changes, it uploads the IP address and subnet mask of the current network and other related data to the server in real time for later functional verification.

2、当用户发起数据共享需求时(如共享一篇房源帖子):2. When a user initiates a data sharing requirement (such as sharing a listing post):

应用程序可以首先查看所属终端是否联网,当终端当前没有联网,则可以输出对应的提示信息,提示对终端进行联网,并在联网之前对数据共享流程进行中止。The application can first check whether the terminal to which it belongs is connected to the Internet. When the terminal is not currently connected to the Internet, it can output corresponding prompt information to prompt the terminal to connect to the Internet, and suspend the data sharing process before connecting to the Internet.

当应用程序监测到所属终端已连接网络时,则可以根据网络监测上报的IP地址以及子网掩码进行判断,查找与当前发起共享数据的终端本机的子网掩码相同的接收终端。对于接收终端的查找过程,发送终端可以先查找出子网掩码相同的目标终端,并获取目标终端的IP地址,然后分别计算各个终端(包括发送终端以及目标终端)的网路地址IP&Mask,然后将与发送终端的IP&Mask相同的目标终端作为同一个局域网中的接收终端,从而通过两次过滤可以筛选出处于同一局域网的接收终端。When the application detects that the terminal to which it belongs is connected to the network, it can judge according to the IP address and subnet mask reported by the network monitoring, and search for the receiving terminal with the same subnet mask as the terminal currently initiating data sharing. For the search process of the receiving terminal, the sending terminal can first find out the target terminal with the same subnet mask, obtain the IP address of the target terminal, and then calculate the network address IP&Mask of each terminal (including the sending terminal and the target terminal) respectively, and then The target terminal with the same IP&Mask as the sending terminal is used as the receiving terminal in the same local area network, so that the receiving terminals in the same local area network can be filtered out through two filters.

当查找到存在可共享的终端群时,将当前数据(一篇帖子)的帖子ID等相关数据打包发送给服务端,服务端在接收到共享数据内容后,可以下发给符合条件的接收终端。接收终端可通过应用程序内弹出的共享请求来确认是否进行接收数据,并在确定接收后接收对应的目标数据,从而当用户在应用程序中发起数据共享时,终端可以通过查找位于同一局域网的其他终端,并向其发送共享数据,在运行同一应用程序的情况下,基于同一局域网的终端可以避免构建用户关系进行数据共享,有效地降低了数据共享的门槛。When a shareable terminal group is found, the relevant data such as the post ID of the current data (a post) are packaged and sent to the server. After receiving the shared data content, the server can send it to eligible receiving terminals. . The receiving terminal can confirm whether to receive data through the sharing request popped up in the application program, and receive the corresponding target data after confirming the reception, so that when the user initiates data sharing in the application program, the terminal can find other devices located in the same local area network. Terminals and send shared data to them. In the case of running the same application, terminals based on the same local area network can avoid building user relationships for data sharing, effectively lowering the threshold for data sharing.

需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明实施例并不受所描述的动作顺序的限制,因为依据本发明实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本发明实施例所必须的。It should be noted that, for the sake of simple description, the method embodiments are described as a series of action combinations, but those skilled in the art should know that the embodiments of the present invention are not limited by the described action sequences, because According to embodiments of the present invention, certain steps may be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

参照图3,示出了本发明实施例中提供的一种数据传输装置的结构框图,具体可以包括如下模块:Referring to FIG. 3, it shows a structural block diagram of a data transmission apparatus provided in an embodiment of the present invention, which may specifically include the following modules:

网络信息获取模块301,用于获取所述发送终端的网络信息;a network information acquisition module 301, configured to acquire network information of the sending terminal;

接收终端查找模块302,用于响应于应用程序内的数据共享指令,根据所述网络信息查找与所述发送终端同属一个局域网的接收终端;The receiving terminal searching module 302 is configured to search for the receiving terminal that belongs to the same local area network as the sending terminal according to the network information in response to the data sharing instruction in the application;

数据发送模块303,用于若存在与所述发送终端同属一个局域网的接收终端,则确定与所述数据共享指令对应的目标数据,并将所述目标数据发送至所述接收终端。The data sending module 303 is configured to determine target data corresponding to the data sharing instruction if there is a receiving terminal belonging to the same local area network as the sending terminal, and send the target data to the receiving terminal.

在一种可选实施例中,所述网络信息至少包括所述发送终端的子网掩码,所述接收终端查找模块302具体用于:In an optional embodiment, the network information includes at least the subnet mask of the sending terminal, and the receiving terminal searching module 302 is specifically configured to:

采用所述子网掩码,查找与所述发送终端同属一个局域网的接收终端。Using the subnet mask, search for a receiving terminal that belongs to the same local area network as the sending terminal.

在一种可选实施例中,所述网络信息还包括所述发送终端的第一IP地址,所述接收终端查找模块302具体用于:In an optional embodiment, the network information further includes the first IP address of the sending terminal, and the receiving terminal searching module 302 is specifically configured to:

查找与所述子网掩码相同的至少一个目标终端,并获取各个所述目标终端的第二IP地址;Find at least one target terminal with the same subnet mask, and obtain the second IP address of each of the target terminals;

采用所述第一IP地址与所述子网掩码,计算所述发送终端的第一网络地址,以及采用所述第二IP地址与所述第一子网掩码,计算所述目标终端的第二网络地址;Use the first IP address and the subnet mask to calculate the first network address of the sending terminal, and use the second IP address and the first subnet mask to calculate the target terminal's the second network address;

将与所述第一网络地址相同的第二网络地址对应的目标终端作为与所述发送终端同属一个局域网的接收终端。A target terminal corresponding to a second network address that is the same as the first network address is used as a receiving terminal that belongs to the same local area network as the sending terminal.

在一种可选实施例中,还包括:In an optional embodiment, it also includes:

第一提示信息显示模块,用于若不存在与所述第一网络地址相同的第二网络地址,则显示针对所述目标终端的第一提示信息,所述第一提示信息为各个所述目标终端与所述发送终端不处于同一个局域网的信息。A first prompt information display module, configured to display first prompt information for the target terminal if there is no second network address that is the same as the first network address, the first prompt information for each of the targets Information that the terminal and the sending terminal are not in the same local area network.

在一种可选实施例中,所述数据发送模块303具体用于:In an optional embodiment, the data sending module 303 is specifically configured to:

将所述目标数据发送至预设服务端,通过所述服务端将所述目标数据发发送至所述接收终端,以使所述接收终端响应数据接收请求,并对所述目标数据进行接收。The target data is sent to a preset server, and the server sends the target data to the receiving terminal, so that the receiving terminal responds to the data receiving request and receives the target data.

在一种可选实施例中,还包括:In an optional embodiment, it also includes:

第二提示信息显示模块,用于若不存在与所述发送终端同属一个局域网的接收终端,则显示针对所述数据共享指令的第二提示信息,所述第二提示信息为不存在与所述发送终端同属一个局域网的终端的信息。The second prompt information display module is configured to display second prompt information for the data sharing instruction if there is no receiving terminal that belongs to the same local area network as the sending terminal, where the second prompt information is that there is no receiving terminal that belongs to the same local area network as the sending terminal. Send the information of the terminals that belong to the same local area network.

在一种可选实施例中,所述目标数据至少包括图片、音频、视频、文档、帖子中的一种。In an optional embodiment, the target data includes at least one of pictures, audios, videos, documents, and posts.

对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。As for the apparatus embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for related parts.

另外,本发明实施例还提供一种电子设备,如图4所示,包括处理器401、通信接口402、存储器403和通信总线404,其中,处理器401,通信接口402,存储器403通过通信总线404完成相互间的通信,In addition, an embodiment of the present invention further provides an electronic device, as shown in FIG. 4 , including a processor 401, a communication interface 402, a memory 403, and a communication bus 404, wherein the processor 401, the communication interface 402, and the memory 403 pass through the communication bus 404 to complete the mutual communication,

存储器403,用于存放计算机程序;a memory 403 for storing computer programs;

处理器401,用于执行存储器403上所存放的程序时,实现如下步骤:When the processor 401 is used to execute the program stored in the memory 403, the following steps are implemented:

获取所述发送终端的网络信息;acquiring network information of the sending terminal;

响应于应用程序内的数据共享指令,根据所述网络信息查找与所述发送终端同属一个局域网的接收终端;In response to the data sharing instruction in the application, search for a receiving terminal that belongs to the same local area network as the sending terminal according to the network information;

若存在与所述发送终端同属一个局域网的接收终端,则确定与所述数据共享指令对应的目标数据,并将所述目标数据发送至所述接收终端。If there is a receiving terminal that belongs to the same local area network as the sending terminal, the target data corresponding to the data sharing instruction is determined, and the target data is sent to the receiving terminal.

在一种可选实施例中,所述网络信息至少包括所述发送终端的子网掩码,所述根据所述网络信息查找与所述发送终端同属一个局域网的接收终端,包括:In an optional embodiment, the network information includes at least a subnet mask of the sending terminal, and the searching for a receiving terminal that belongs to the same local area network as the sending terminal according to the network information includes:

采用所述子网掩码,查找与所述发送终端同属一个局域网的接收终端。Using the subnet mask, search for a receiving terminal that belongs to the same local area network as the sending terminal.

在一种可选实施例中,所述网络信息还包括所述发送终端的第一IP地址,所述采用所述子网掩码,查找与所述发送终端同属一个局域网的接收终端,包括:In an optional embodiment, the network information further includes the first IP address of the sending terminal, and the use of the subnet mask to search for a receiving terminal that belongs to the same local area network as the sending terminal includes:

查找与所述子网掩码相同的至少一个目标终端,并获取各个所述目标终端的第二IP地址;Find at least one target terminal with the same subnet mask, and obtain the second IP address of each of the target terminals;

采用所述第一IP地址与所述子网掩码,计算所述发送终端的第一网络地址,以及采用所述第二IP地址与所述第一子网掩码,计算所述目标终端的第二网络地址;Use the first IP address and the subnet mask to calculate the first network address of the sending terminal, and use the second IP address and the first subnet mask to calculate the target terminal's the second network address;

将与所述第一网络地址相同的第二网络地址对应的目标终端作为与所述发送终端同属一个局域网的接收终端。A target terminal corresponding to a second network address that is the same as the first network address is used as a receiving terminal that belongs to the same local area network as the sending terminal.

在一种可选实施例中,还包括:In an optional embodiment, it also includes:

若不存在与所述第一网络地址相同的第二网络地址,则显示针对所述目标终端的第一提示信息,所述第一提示信息为各个所述目标终端与所述发送终端不处于同一个局域网的信息。If there is no second network address that is the same as the first network address, first prompt information for the target terminal is displayed, and the first prompt information is that each of the target terminals is not in the same location as the sending terminal. information on a local area network.

在一种可选实施例中,所述将所述目标数据发送至所述接收终端,包括:In an optional embodiment, the sending the target data to the receiving terminal includes:

将所述目标数据发送至预设服务端,通过所述服务端将所述目标数据发发送至所述接收终端,以使所述接收终端响应数据接收请求,并对所述目标数据进行接收。The target data is sent to a preset server, and the server sends the target data to the receiving terminal, so that the receiving terminal responds to the data receiving request and receives the target data.

在一种可选实施例中,还包括:In an optional embodiment, it also includes:

若不存在与所述发送终端同属一个局域网的接收终端,则显示针对所述数据共享指令的第二提示信息,所述第二提示信息为不存在与所述发送终端同属一个局域网的终端的信息。If there is no receiving terminal that belongs to the same local area network as the sending terminal, second prompt information for the data sharing instruction is displayed, and the second prompt information is information that there is no terminal that belongs to the same local area network as the sending terminal. .

在一种可选实施例中,所述目标数据至少包括图片、音频、视频、文档、帖子中的一种。In an optional embodiment, the target data includes at least one of pictures, audios, videos, documents, and posts.

上述终端提到的通信总线可以是外设部件互连标准(Peripheral ComponentInterconnect,简称PCI)总线或扩展工业标准结构(Extended Industry StandardArchitecture,简称EISA)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The communication bus mentioned by the above terminal may be a Peripheral Component Interconnect (PCI for short) bus or an Extended Industry Standard Architecture (Extended Industry Standard Architecture, EISA for short) bus or the like. The communication bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of presentation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

通信接口用于上述终端与其他设备之间的通信。The communication interface is used for communication between the above-mentioned terminal and other devices.

存储器可以包括随机存取存储器(Random Access Memory,简称RAM),也可以包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。可选的,存储器还可以是至少一个位于远离前述处理器的存储装置。The memory may include random access memory (Random Access Memory, RAM for short), and may also include non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等;还可以是数字信号处理器(Digital Signal Processing,简称DSP)、专用集成电路(Application SpecificIntegrated Circuit,简称ASIC)、现场可编程门阵列(Field-Programmable Gate Array,简称FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。The above-mentioned processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, referred to as CPU), a network processor (Network Processor, referred to as NP), etc.; may also be a digital signal processor (Digital Signal Processing, referred to as DSP) , Application Specific Integrated Circuit (ASIC for short), Field-Programmable Gate Array (FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

如图5所示,在本发明提供的又一实施例中,还提供了一种计算机可读存储介质501,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述实施例中所述的数据传输方法。As shown in FIG. 5 , in yet another embodiment provided by the present invention, a computer-readable storage medium 501 is also provided, where instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium runs on a computer, the computer The data transmission method described in the above embodiment is performed.

在本发明提供的又一实施例中,还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述实施例中所述的数据传输方法。In yet another embodiment provided by the present invention, there is also provided a computer program product containing instructions, which, when run on a computer, cause the computer to execute the data transmission method described in the above embodiments.

在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。In the above-mentioned embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented in software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer may be a general purpose computer, special purpose computer, computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center is by wire (eg, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that includes an integration of one or more available media. The usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, Solid State Disk (SSD)), among others.

需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any relationship between these entities or operations. any such actual relationship or sequence exists. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion such that a process, method, article or device comprising a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.

本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a related manner, and the same and similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for related parts, please refer to the partial descriptions of the method embodiments.

以上所述仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本发明的保护范围内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (10)

1. A data transmission method, applied to a transmitting terminal, the method comprising:
acquiring network information of the sending terminal;
responding to a data sharing instruction in an application program, and searching a receiving terminal which belongs to the same local area network as the sending terminal according to the network information;
and if a receiving terminal which belongs to the same local area network as the sending terminal exists, determining target data corresponding to the data sharing instruction, and sending the target data to the receiving terminal.
2. The method according to claim 1, wherein the network information at least includes a subnet mask of the sending terminal, and the searching for the receiving terminal belonging to the same local area network as the sending terminal according to the network information comprises:
and searching a receiving terminal which belongs to a local area network with the transmitting terminal by adopting the subnet mask.
3. The method of claim 2, wherein the network information further includes a first IP address of the sending terminal, and wherein the searching for the receiving terminal belonging to a local area network with the sending terminal using the subnet mask comprises:
searching at least one target terminal which is the same as the subnet mask, and acquiring a second IP address of each target terminal;
calculating a first network address of the transmitting terminal by using the first IP address and the subnet mask, and calculating a second network address of the target terminal by using the second IP address and the first subnet mask;
and taking the target terminal corresponding to the second network address which is the same as the first network address as a receiving terminal which belongs to the same local area network with the sending terminal.
4. The method of claim 3, further comprising:
and if the second network address which is the same as the first network address does not exist, displaying first prompt information aiming at the target terminal, wherein the first prompt information is information that each target terminal and the sending terminal are not in the same local area network.
5. The method according to any one of claims 1 to 3, wherein the sending the target data to the receiving terminal comprises:
and sending the target data to a preset server, and sending the target data to the receiving terminal through the server so that the receiving terminal responds to a data receiving request and receives the target data.
6. The method of claim 1, further comprising:
and if the receiving terminal which belongs to the same local area network as the sending terminal does not exist, displaying second prompt information aiming at the data sharing instruction, wherein the second prompt information is information that the terminal which belongs to the same local area network as the sending terminal does not exist.
7. The method of claim 1, wherein the target data comprises at least one of a picture, audio, video, document, post.
8. A data transmission apparatus, applied to a transmitting terminal, the apparatus comprising:
a network information acquisition module for acquiring the network information of the sending terminal;
the receiving terminal searching module is used for responding to a data sharing instruction in an application program and searching a receiving terminal which belongs to a local area network with the sending terminal according to the network information;
and the data sending module is used for determining target data corresponding to the data sharing instruction and sending the target data to the receiving terminal if the receiving terminal which belongs to the same local area network as the sending terminal exists.
9. An electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
the memory is used for storing a computer program;
the processor, when executing a program stored on the memory, implementing the method of any of claims 1-7.
10. A computer-readable storage medium having stored thereon instructions, which when executed by one or more processors, cause the processors to perform the method of any one of claims 1-7.
CN202210335407.4A 2022-03-31 2022-03-31 Data transmission method and device, electronic equipment and storage medium Pending CN114844849A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210335407.4A CN114844849A (en) 2022-03-31 2022-03-31 Data transmission method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210335407.4A CN114844849A (en) 2022-03-31 2022-03-31 Data transmission method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114844849A true CN114844849A (en) 2022-08-02

Family

ID=82563861

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210335407.4A Pending CN114844849A (en) 2022-03-31 2022-03-31 Data transmission method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114844849A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105700846A (en) * 2016-03-18 2016-06-22 北京小米移动软件有限公司 File sharing method and device
CN106789470A (en) * 2016-12-23 2017-05-31 Tcl海外电子(惠州)有限公司 terminal resource sharing method, device and system
WO2017156934A1 (en) * 2016-03-14 2017-09-21 乐视控股(北京)有限公司 Intelligent interconnecting method, and intelligent terminal
CN109561124A (en) * 2017-09-27 2019-04-02 深圳市创易联合科技有限公司 A kind of method, system and the terminal device of file transmission
CN112752353A (en) * 2019-10-31 2021-05-04 中移物联网有限公司 Connection method and terminal equipment
CN113301135A (en) * 2021-05-14 2021-08-24 涂哲 Data sharing method
CN114051214A (en) * 2021-11-15 2022-02-15 杭州老板电器股份有限公司 Method, device and system for sharing terminal functions
EP3968670A1 (en) * 2019-06-28 2022-03-16 Huawei Technologies Co., Ltd. Bluetooth-based object searching method and electronic device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017156934A1 (en) * 2016-03-14 2017-09-21 乐视控股(北京)有限公司 Intelligent interconnecting method, and intelligent terminal
CN105700846A (en) * 2016-03-18 2016-06-22 北京小米移动软件有限公司 File sharing method and device
CN106789470A (en) * 2016-12-23 2017-05-31 Tcl海外电子(惠州)有限公司 terminal resource sharing method, device and system
CN109561124A (en) * 2017-09-27 2019-04-02 深圳市创易联合科技有限公司 A kind of method, system and the terminal device of file transmission
EP3968670A1 (en) * 2019-06-28 2022-03-16 Huawei Technologies Co., Ltd. Bluetooth-based object searching method and electronic device
CN112752353A (en) * 2019-10-31 2021-05-04 中移物联网有限公司 Connection method and terminal equipment
CN113301135A (en) * 2021-05-14 2021-08-24 涂哲 Data sharing method
CN114051214A (en) * 2021-11-15 2022-02-15 杭州老板电器股份有限公司 Method, device and system for sharing terminal functions

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张欣奇;: "Windows环境下的局域网共享", 信息与电脑(理论版), no. 10 *

Similar Documents

Publication Publication Date Title
KR101570406B1 (en) Method and apparatus for implementing user relationship in social network application
CN107040494B (en) User account abnormity prevention method and system
US9166987B2 (en) Preventing identity fraud for instant messaging
CN111314181B (en) Network connectivity diagnosis method, device, terminal and storage medium
CN110662209B (en) Screen-throwing equipment connection method and device in isolation network
EP2898420A1 (en) A data-sharing method, terminal, server, and system
US20160285781A1 (en) Data processing method, apparatus, client, server and system
WO2017071087A1 (en) Method, apparatus and equipment for transmission of information
US20140325628A1 (en) Login method, apparatus, and system
CN104754563A (en) A wireless hotspot access sharing method, mobile terminal and system
CN110138801A (en) File sharing method, device, system, server, terminal and storage medium
TW201906433A (en) Wireless network type detection method, device and electronic device
CN106488394A (en) Method and device for device connection
CN110191131A (en) A file sharing method, device, system, server and storage medium
US20140089430A1 (en) Data-sharing method, terminal, server, and system
CN105049452B (en) Resource downloading mode switching method and device and intelligent terminal
CN106302519A (en) The method of a kind of internet security management and terminal
WO2024041436A1 (en) Service request processing method and apparatus, and electronic device and storage medium
CN114844849A (en) Data transmission method and device, electronic equipment and storage medium
CN111506895A (en) Construction method and device of application login graph
CN111262779A (en) Data acquisition method, device, server and system in instant messaging
US10019582B1 (en) Detecting application leaks
CN114222176A (en) Synchronous screen projection method, equipment and storage medium
CN114172713A (en) Login method, login device, electronic equipment and storage medium
CN114499942A (en) Data access method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20220802