Disclosure of Invention
The embodiment of the application provides a resource sharing method and device and electronic equipment, and aims to solve the problem that in the prior art, a solution for a scene in which a plurality of people scan two-dimensional codes simultaneously is not optimized.
In order to solve the above technical problem, the embodiments of the present application are implemented as follows:
in a first aspect, a resource sharing method is provided, where the method is applied to a first terminal, and the method includes:
acquiring broadcast data, wherein the broadcast data comprises a terminal identifier and a resource identifier;
establishing connection with a second terminal corresponding to the terminal identification;
and receiving the resource content corresponding to the resource identification.
In a second aspect, a resource sharing method is provided, where the method is applied to a second terminal, and the method includes:
sending broadcast data, wherein the broadcast data comprises a terminal identifier and a resource identifier of the second terminal;
receiving a connection request of a first terminal, and establishing connection with the first terminal;
and sending the resource content corresponding to the resource identifier to the first terminal.
In a third aspect, a resource sharing apparatus is provided, including:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring broadcast data which comprises a terminal identifier and a resource identifier;
the connection unit is used for establishing connection with a second terminal corresponding to the terminal identifier;
and the receiving unit is used for receiving the resource content corresponding to the resource identifier.
In a fourth aspect, a resource sharing apparatus is provided, including:
a first sending unit, configured to send broadcast data, where the broadcast data includes a terminal identifier and a resource identifier of the second terminal;
the receiving unit is used for receiving a connection request of a first terminal and establishing connection with the first terminal;
and the second sending unit is used for sending the resource content corresponding to the resource identifier to the first terminal.
In a fifth aspect, an electronic device is provided, which includes:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
acquiring broadcast data, wherein the broadcast data comprises a terminal identifier and a resource identifier;
establishing connection with a second terminal corresponding to the terminal identification;
and receiving the resource content corresponding to the resource identification.
In a sixth aspect, a computer-readable storage medium is presented, storing one or more programs, which when executed by an electronic device that includes a plurality of application programs, cause the electronic device to:
acquiring broadcast data, wherein the broadcast data comprises a terminal identifier and a resource identifier;
establishing connection with a second terminal corresponding to the terminal identifier;
and receiving the resource content corresponding to the resource identification.
In a seventh aspect, an electronic device is provided, which includes:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
sending broadcast data, wherein the broadcast data comprises a terminal identifier and a resource identifier of the second terminal;
receiving a connection request of a first terminal, and establishing connection with the first terminal;
and sending the resource content corresponding to the resource identifier to the first terminal.
In an eighth aspect, a computer-readable storage medium is presented, storing one or more programs, which when executed by an electronic device that includes a plurality of application programs, cause the electronic device to:
sending broadcast data, wherein the broadcast data comprises a terminal identifier and a resource identifier of the second terminal;
receiving a connection request of a first terminal, and establishing connection with the first terminal;
and sending the resource content corresponding to the resource identifier to the first terminal.
The embodiment of the application can at least achieve the following technical effects by adopting the technical scheme:
when a plurality of users need to acquire a certain resource at the same time, for example, scanning a two-dimensional code, because a first terminal can first acquire broadcast data, the broadcast data comprises a terminal identifier and a resource identifier, then a connection can be established with a second terminal corresponding to the terminal identifier, and finally, the resource content corresponding to the resource identifier can be received. Like this after a user in a plurality of users passes through terminal equipment and scans the two-dimensional code and acquires the two-dimensional code value that corresponds, alright in order to send broadcast data through this user's terminal equipment, including the terminal equipment's of this user terminal equipment and the sign of the two-dimensional code that scans in this broadcast data, other users alright in order to acquire this broadcast data, and establish the connection with the terminal equipment who sends broadcast data, in order to acquire the two-dimensional code value that corresponds with the sign of two-dimensional code, thereby avoided waiting in line to scan the two-dimensional code, provide very big facility for the user.
When a plurality of users need to acquire a certain resource at the same time, for example, scanning a two-dimensional code, since the second terminal can send broadcast data, the broadcast data includes a terminal identifier and a resource identifier of the second terminal, and then can receive a connection request of the first terminal, establish a connection with the first terminal, and finally can send resource content corresponding to the resource identifier to the first terminal. Like this after a user in a plurality of users passes through terminal equipment and scans the two-dimensional code and acquires the two-dimensional code value that corresponds, alright in order to send broadcast data through this user's terminal equipment, including the terminal equipment's of this user terminal equipment and the sign of the two-dimensional code that scans in this broadcast data, other users alright in order to acquire this broadcast data, and establish the connection with the terminal equipment who sends broadcast data, in order to acquire the two-dimensional code value that corresponds with the sign of two-dimensional code, thereby avoided waiting in line to scan the two-dimensional code, provide very big facility for the user.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only a few embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
In order to solve the problem that a resource sharing method, a resource sharing device and an electronic device are not optimized enough for solving a problem that a scene in which a plurality of people scan a two-dimensional code simultaneously in the prior art, embodiments of the present specification provide a resource sharing method. An execution subject of the resource sharing method provided in the embodiments of the present disclosure may be, but is not limited to, a mobile phone, a tablet computer, a personal computer, and the like, which are capable of being configured to execute at least one of the user terminals of the method provided in the embodiments of the present disclosure, or the execution subject of the method may also be a client itself capable of executing the method.
For convenience of description, the following description will be made of an embodiment of the method taking as an example that an execution subject of the method is a terminal device capable of executing the method. It is understood that the implementation of the method by the terminal device is only an exemplary illustration, and should not be construed as a limitation of the method.
Specifically, an implementation flow diagram of a resource sharing method provided in one or more embodiments of the present specification is shown in fig. 1, where the method is applied to a first terminal, and includes:
step 110, acquiring broadcast data, wherein the broadcast data comprises a terminal identifier and a resource identifier;
taking a scene that a plurality of users scan the two-dimensional code together as an example, in order to avoid the problem that users far away from the two-dimensional code are difficult to scan the two-dimensional code, the embodiment of the invention utilizes the function that the bluetooth 4.0 or the version more than the bluetooth 4.0 can send broadcast data to the outside, so as to solve the problem. Optionally, the acquiring broadcast data includes: firstly, searching for terminal equipment for starting Bluetooth communication; then, if a second terminal of the broadcast resource is searched, broadcast data of the second terminal is obtained, and the broadcast data includes a terminal identifier and a resource identifier of the second terminal.
It should be understood that the first terminal should turn on the bluetooth communication function before acquiring the broadcast data, and scan nearby terminal devices (i.e., bluetooth devices) that turn on bluetooth communication, and when scanning nearby bluetooth devices, bluetooth devices within a preset range from the first terminal are displayed in the first terminal in a list. The list not only includes the terminal identifiers of the bluetooth devices, but also includes the resource identifiers broadcast by the bluetooth devices of the broadcast resources, and the user can acquire the terminal identifiers of the bluetooth devices of the broadcast resources and the resource identifiers broadcast by the bluetooth devices by looking up the search results.
Step 120, establishing connection with a second terminal corresponding to the terminal identifier;
it should be understood that, in order to obtain the resource content corresponding to the resource identifier included in the broadcast data of the second terminal, a connection may be established with the second terminal corresponding to the terminal identifier to obtain the resource content corresponding to the resource identifier. Optionally, the second terminal corresponding to the terminal identifier may first send a bluetooth connection request to the second terminal corresponding to the terminal identifier; then, a bluetooth connection is established with the second terminal. Wherein, after transmitting the bluetooth connection request to the second terminal, the second terminal may establish a bluetooth connection with the first terminal in response to the bluetooth connection request.
Step 130, receiving the resource content corresponding to the resource identification.
Optionally, the resource content corresponding to the resource identifier is received, specifically, the resource content corresponding to the resource identifier may be received through bluetooth communication. Taking the resource as the two-dimensional code as an example, the two-dimensional code value corresponding to the two-dimensional code identifier may be received.
The following describes the resource sharing method according to the embodiment of the present invention in detail by taking fig. 2 as an example. Such as
Fig. 2 is a schematic view of a process of applying the resource sharing method provided in the embodiment of the present invention to an actual scene, where the scene is a scene in which multiple people scan two-dimensional codes simultaneously, and includes a user a mobile phone and a user B mobile phone, where the user a mobile phone is a terminal device that scans two-dimensional codes in the scene, and the user B mobile phone is a terminal device that is far away from a two-dimensional code image and does not scan two-dimensional codes. That is to say, fig. 2 is a schematic view of a scene in which the mobile phone of the user a analyzes the scanned two-dimensional code to the mobile phone of the user B, and includes the following main steps:
step 211, the mobile phone of the user A opens a scanning application program and scans the two-dimensional code;
step 212, the user A mobile phone starts the Bluetooth and sends broadcast data to the outside, wherein the broadcast data comprises a terminal identifier and a two-dimension code identifier of the user A mobile phone;
step 213, the user B mobile phone starts the Bluetooth and searches nearby Bluetooth equipment;
step 214, the mobile phone of the user B searches the Bluetooth equipment for sending the broadcast data;
the mobile phone of the user B can check whether other terminal devices share the two-dimensional code or not by searching nearby Bluetooth devices, and can acquire the terminal identifier and the two-dimensional code identifier included in the broadcast data after the Bluetooth devices which send the broadcast data are searched.
Step 215, the user B mobile phone initiates a Bluetooth connection to the Bluetooth device sending the broadcast data;
the user B handset transmits a bluetooth connection request to a terminal device (i.e., bluetooth device) corresponding to the terminal identification contained in the broadcast data.
Step 216, the user a mobile phone receives the bluetooth connection request sent by the user B mobile phone, and responds to the bluetooth connection request to establish bluetooth connection with the user B mobile phone;
step 217, the user A mobile phone sends the two-dimension code value to the user B mobile phone;
step 218, receiving the two-dimension code value by the mobile phone of the user B;
in step 219, after the user B mobile phone obtains the two-dimensional code value, the user B mobile phone may disconnect the bluetooth connection with the user a mobile phone in order to improve information security.
When a plurality of users need to acquire a certain resource at the same time, for example, scanning a two-dimensional code, because a first terminal can first acquire broadcast data, the broadcast data comprises a terminal identifier and a resource identifier, then a connection can be established with a second terminal corresponding to the terminal identifier, and finally, the resource content corresponding to the resource identifier can be received. Like this after a user in a plurality of users passes through terminal equipment and scans the two-dimensional code and acquires the two-dimensional code value that corresponds, alright in order to send broadcast data through this user's terminal equipment, including the terminal equipment's of this user terminal equipment and the sign of the two-dimensional code that scans in this broadcast data, other users alright in order to acquire this broadcast data, and establish the connection with the terminal equipment who sends broadcast data, in order to acquire the two-dimensional code value that corresponds with the sign of two-dimensional code, thereby avoided waiting in line to scan the two-dimensional code, provide very big facility for the user.
Fig. 3 is a schematic implementation flow diagram of another resource sharing method according to an embodiment of the present disclosure. As shown in fig. 3, the method comprises the following main steps:
step 310, sending broadcast data, wherein the broadcast data comprises a terminal identifier and a resource identifier of a second terminal;
alternatively, the broadcast data may be transmitted, and specifically, the broadcast data may be transmitted through bluetooth communication. It should be understood that after the broadcast data is sent through bluetooth communication, after the bluetooth communication function is turned on by other terminal devices within a preset range from the second terminal, the broadcast data may be received, and the terminal identifier and the resource identifier of the second terminal included in the broadcast data may be obtained.
Step 320, receiving a connection request of a first terminal;
optionally, receiving a connection request of the first terminal, specifically, first, receiving a bluetooth connection request of the first terminal; then, a bluetooth connection is established with the first terminal in response to a bluetooth connection request of the first terminal.
Step 330, sending the resource content corresponding to the resource identifier to the first terminal.
The specific implementation of the relevant steps in the embodiment shown in fig. 3 may refer to the specific implementation of the corresponding steps in the embodiment shown in fig. 1, and one or more embodiments in this specification are not described herein again.
When a plurality of users need to acquire a certain resource at the same time, for example, scanning a two-dimensional code, since the second terminal can send broadcast data, the broadcast data includes a terminal identifier and a resource identifier of the second terminal, and then can receive a connection request of the first terminal, establish a connection with the first terminal, and finally can send resource content corresponding to the resource identifier to the first terminal. Like this after a user in a plurality of users passes through terminal equipment and scans the two-dimensional code and acquires the two-dimensional code value that corresponds, alright in order to send broadcast data through this user's terminal equipment, including the terminal equipment's of this user terminal equipment and the sign of the two-dimensional code that scans in this broadcast data, other users alright in order to acquire this broadcast data, and establish the connection with the terminal equipment who sends broadcast data, in order to acquire the two-dimensional code value that corresponds with the sign of two-dimensional code, thereby avoided waiting in line to scan the two-dimensional code, provide very big facility for the user.
Fig. 4 is a schematic structural diagram of a resource sharing apparatus 400 provided in the present specification. Referring to fig. 4, in a software implementation, a resource sharing apparatus 400 may include an obtaining unit 401 and a connecting unit 402, wherein:
an obtaining unit 401, configured to obtain broadcast data, where the broadcast data includes a terminal identifier and a resource identifier;
a connection unit 402, configured to establish a connection with a second terminal corresponding to the terminal identifier;
a receiving unit 403, receiving the resource content corresponding to the resource identifier.
Alternatively, in one embodiment, the obtaining unit 401,
searching for a terminal device starting Bluetooth communication;
and if a second terminal of the broadcast resource is searched, acquiring the broadcast data of the second terminal, wherein the broadcast data comprises a terminal identifier and a resource identifier of the second terminal.
Alternatively, in one embodiment, the connection unit 402,
sending a Bluetooth connection request to a second terminal corresponding to the terminal identifier;
and establishing Bluetooth connection with the second terminal.
Optionally, in an embodiment, the resource includes a two-dimensional code.
The resource sharing apparatus 400 can implement the method of the embodiment of the method shown in fig. 1 to fig. 2, and reference may be specifically made to the resource sharing method of the embodiment shown in fig. 1, which is not described again.
Fig. 5 is a schematic structural diagram of a resource sharing apparatus 500 provided in the present specification. Referring to fig. 5, in a software implementation, the resource sharing apparatus 500 may include a first sending unit 501, a receiving unit 502, and a second sending unit 503, wherein:
a first sending unit 501, configured to send broadcast data, where the broadcast data includes a terminal identifier and a resource identifier of the second terminal;
a receiving unit 502 that receives a connection request of a first terminal;
a second sending unit 503, sending the resource content corresponding to the resource identifier to the first terminal.
Optionally, in one embodiment, the first sending unit 501,
the broadcast data is transmitted through bluetooth communication.
Optionally, in an embodiment, the receiving unit 502 is configured to:
receiving a Bluetooth connection request of the first terminal;
and responding to the Bluetooth connection request of the first terminal, and establishing Bluetooth connection with the first terminal.
Optionally, in an embodiment, the resource includes a two-dimensional code.
The resource sharing apparatus 500 can implement the method of the embodiment of the method in fig. 3, and reference may be specifically made to the resource sharing method in the embodiment shown in fig. 3, which is not described again.
Fig. 6 is a schematic structural diagram of an electronic device provided in an embodiment of the present specification. Referring to fig. 6, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 6, but that does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory to the memory and then runs the computer program to form the resource sharing device on the logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
acquiring broadcast data, wherein the broadcast data comprises a terminal identifier and a resource identifier;
establishing connection with a second terminal corresponding to the terminal identification;
and receiving the resource content corresponding to the resource identification.
The resource sharing method disclosed in the embodiment shown in fig. 1 of the present specification may be applied to a processor, or may be implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or by instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in one or more embodiments of the present specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with one or more embodiments of the present disclosure may be embodied directly in hardware, in a software module executed by a hardware decoding processor, or in a combination of the hardware and software modules executed by a hardware decoding processor. The software modules may be located in ram, flash, rom, prom, or eprom, registers, etc. as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may further execute the method for determining resource sharing in fig. 1 to fig. 2, which is not described herein again.
Of course, besides the software implementation, the electronic device in the present specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present specification. Referring to fig. 7, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 7, but this does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory to the memory and then runs the computer program to form the resource sharing device on the logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
sending broadcast data, wherein the broadcast data comprises a terminal identifier and a resource identifier of the second terminal;
receiving a connection request of a first terminal;
and sending the resource content corresponding to the resource identifier to the first terminal.
The resource sharing method disclosed in the embodiment of fig. 3 of the present specification can be applied to a processor, or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in one or more embodiments of the present specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with one or more embodiments of the present disclosure may be embodied directly in hardware, in a software module executed by a hardware decoding processor, or in a combination of the hardware and software modules executed by a hardware decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may further execute the resource sharing method of fig. 3, which is not described herein again.
Of course, besides the software implementation, the electronic device in this specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
In short, the above description is only a preferred embodiment of the present disclosure, and is not intended to limit the scope of the present disclosure. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of the present disclosure should be included in the scope of protection of one or more embodiments of the present disclosure.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the system embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points.