CN109246080B - Resource sharing method, device, equipment and computer readable storage medium - Google Patents
Resource sharing method, device, equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN109246080B CN109246080B CN201810877759.6A CN201810877759A CN109246080B CN 109246080 B CN109246080 B CN 109246080B CN 201810877759 A CN201810877759 A CN 201810877759A CN 109246080 B CN109246080 B CN 109246080B
- Authority
- CN
- China
- Prior art keywords
- sound
- target
- request
- target resource
- requesting party
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 64
- 230000008569 process Effects 0.000 claims abstract description 27
- 230000004048 modification Effects 0.000 claims description 22
- 238000012986 modification Methods 0.000 claims description 22
- 238000004590 computer program Methods 0.000 claims description 11
- 238000004364 calculation method Methods 0.000 claims description 10
- 230000007246 mechanism Effects 0.000 claims description 9
- 238000012163 sequencing technique Methods 0.000 claims description 8
- 230000001960 triggered effect Effects 0.000 claims description 2
- 230000009471 action Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000000977 initiatory effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 238000005406 washing Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/10—Network architectures or network communication protocols for network security for controlling access to devices or network resources
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/10—Network architectures or network communication protocols for network security for controlling access to devices or network resources
- H04L63/101—Access control lists [ACL]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Storage Device Security (AREA)
- Telephonic Communication Services (AREA)
Abstract
The invention discloses a resource sharing method, a device, equipment and a computer readable storage medium, wherein the method comprises the steps of receiving request information sent by a sound of a requester, wherein the request information comprises target resource information and the sound information of the requester; judging whether the requesting party sound equipment has the acquisition authority of the target resource or not according to the request information, if so, acquiring the target resource; if not, determining a target sound from all the sounds with the target resource acquisition authority, and acquiring a corresponding target resource according to the target resource acquisition authority of the target sound; and establishing an access link corresponding to the target resource according to the target resource and the information of the requesting party sound equipment, and returning the access link to the requesting party sound equipment so that the requesting party sound equipment can access the target resource according to the access link. The method and the device can ensure the account and information safety of the sharing party sound equipment in the using process, and can also enable the requesting party sound equipment to access resources without permission under the condition of logging in the account, so that the user experience is improved.
Description
Technical Field
The present invention relates to the field of information sharing technologies, and in particular, to a resource sharing method, apparatus, device, and computer-readable storage medium.
Background
With the continuous progress of intelligent identification technology, a simple life style is difficult to meet the daily life of people, and the development of the simple patch board is not in the direction of intelligence when the simple life style goes to a smart phone and goes to the simple patch board. The intelligent sound is a product of sound upgrading, and is a tool for household consumers to surf the internet by voice, such as song-on-demand, online shopping or weather forecast understanding.
The smart audio has been regarded as a future home smart control terminal, which is a point of great importance for all manufacturers. From the development conditions at the present stage, the smart sound can already control basic smart home equipment, like a universal voice remote controller, and can control corresponding smart home equipment such as light, curtains, televisions, air conditioners, washing machines, electric cookers and the like. In addition, the life service is also an important function of the intelligent sound box, and information such as peripheral information, restaurant sales promotion information, road conditions, trains, air tickets, hotels and the like can be inquired through cooperation with third-party applications such as paying public praise, dropping and dropping lines and the like.
Under a general condition, a user manages resources of the intelligent sound box by using an account, and meanwhile, the user can purchase the resources according to personal preference, namely, the user can acquire the resources which the user does not have by purchasing the corresponding resources. For a few used resources, the direct purchase cannot well meet the user requirements, and therefore, a mechanism for sharing resource acquisition permission is needed to help the user obtain limited resource acquisition permission to the user having the resource acquisition permission. In the existing resource sharing scheme, a requester is informed of an account and a password of a sharing party, and the requester directly logs in the account to use corresponding resources. According to the resource sharing scheme in the prior art, on one hand, certain hidden dangers are brought to privacy safety and information confidentiality of a sharing party, and on the other hand, a requesting party user can acquire corresponding resources only by logging in accounts of other users, so that the requesting party user has poor experience.
In view of the above, how to provide a resource sharing method, device, apparatus and computer readable storage medium for solving the above technical problems becomes a problem to be solved by those skilled in the art.
Disclosure of Invention
The embodiment of the invention aims to provide a resource sharing method, a resource sharing device and a computer readable storage medium, which can ensure the account and information security of a sharing party sound box in the using process, can also enable a requesting party sound box to access resources without acquiring authority under the condition of logging in the account of the requesting party sound box, and improve the user experience.
To solve the foregoing technical problem, an embodiment of the present invention provides a resource sharing method, including:
s11: receiving request information sent by a requesting party sound, wherein the request information comprises target resource information and requesting party sound information;
s12: judging whether the sound of the requesting party has the acquisition authority of the target resource or not according to the request information, if so, acquiring the target resource, and entering S15; if not, go to S13;
s13: determining a target sound from all sounds with the target resource acquisition authority;
s14: acquiring corresponding target resources according to the target resource acquisition authority of the target sound equipment;
s15: and establishing an access link corresponding to the target resource according to the target resource and the information of the requesting party sound equipment, and returning the access link to the requesting party sound equipment so that the requesting party sound equipment can access the target resource according to the access link.
Optionally, after receiving the request information sent by the requestor sound, before the determining, according to the request information, whether the requestor sound has the right to acquire the target resource, the method further includes:
generating a request event according to the request information, wherein the request event comprises the request information;
determining the adding position of the request event in a request queue according to the request information and a preset queuing mechanism;
adding the request event to the request queue according to the adding position;
polling all request events in the request queue, and acquiring the request events and the request information from the request queue.
Optionally, the process of determining the adding position of the request event in the request queue according to the request information and a preset queuing mechanism is as follows:
s21: acquiring parameter information of the requesting party sound according to the request information, wherein the parameter information of the requesting party sound comprises a gain value, a first index value, a resource sharing amount, a sharing proportion and an integral value;
s22: determining the adding position of the request event in a request queue according to the parameter information of the sound of the requesting party and the adding position calculation relational expression;
the adding position calculation relational expression is as follows:and l ═ max { l',0 }; wherein,α + β + γ ═ 1; wherein:
l is the adding position of the request event, L is the length of a request queue, a is the gain value of the request party sound, H is the first index value of the request party sound, and H is the sound index value threshold; m is the resource sharing amount of the requesting party ' S stereo, P is the sharing ratio of the requesting party ' S stereo, S is the integral value of the requesting party ' S stereo, M is the stereo sharing amount threshold, P is the stereo sharing ratio threshold, S is the stereo integral value threshold, and α, β, and γ are constants.
Optionally, the process of determining a target sound from the sounds having the target resource acquisition right includes:
s31: acquiring parameter information of the request event;
s32: and when the parameter information of the request event meets a preset condition, determining each sound equipment with the target resource acquisition authority, and determining the target sound equipment from the sound equipment with the target resource acquisition authority according to a preset rule.
Optionally, the parameter information of the request event includes an event processing period T, an event modification number N, an integral value s of the sound of the requesting party, the event processing period T, an event modification number threshold N, and an event modification number maximum upper limit value W;
then, when the parameter information of the request event meets a preset condition, determining each sound equipment with the target resource acquisition permission, and determining a target sound equipment from each sound equipment with the target resource acquisition permission according to a preset rule comprises the following steps:
s321: when N is less than W, judging whether T and N meet T is more than or equal to T or N is more than or equal to N, if yes, entering S322; if not, go to S326;
s322: judging whether a first sound device with the target resource acquisition authority and the authority attribute in a default sharing state exists, if so, entering S323; otherwise, go to S324;
s323: determining each first sound device with the target resource acquisition permission and the permission attribute in a default sharing state, and randomly selecting one first sound device from the first sound devices as a target sound device;
s324: judging whether the target resource acquisition permission exists or not and the permission attribute is in a non-default sharing state, if so, entering S325;
s325: determining each second sound which has the target resource acquisition authority and the authority attribute of which is in a non-default sharing state, sequencing the second sounds according to the integral value from large to small, and randomly selecting one second sound from the sequenced second sounds as a target sound;
s326: according to the calculation relationCalculating a second index value H ' of the sound of the requesting party, and judging whether H ' meets the condition that H ' is more than or equal to H, if so, entering S322, otherwise, entering S327; wherein α '+ β' + γ '═ 1, α', β ', and γ' are all constants;
s327: and determining each second sound which has the target resource acquisition authority and the authority attribute of which is in a non-default sharing state, sequencing the second sounds according to the integral value from large to small, and randomly selecting one sound from a preset number of second sounds as the target sound.
Optionally, the process of acquiring the corresponding target resource according to the target resource acquisition permission of the target sound device includes:
acquiring authority attribute of the target sound according to the target resource acquisition authority of the target sound;
when the authority attribute of the target sound equipment is in a default sharing state, directly acquiring the target resource;
and when the authority attribute of the target sound is in a non-default sharing state, sending an inquiry request to the target sound, and acquiring the target resource according to an allowed sharing reply returned by the target sound.
The embodiment of the invention correspondingly provides a resource sharing device, which comprises:
the system comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for receiving request information sent by a sound of a requesting party, and the request information comprises target resource information and sound information of the requesting party;
the first judgment module is used for judging whether the sound of the requester has the acquisition authority of the target resource or not according to the request information, if so, the target resource is acquired, and the establishment module is triggered; if not, triggering a selection module;
the selection module is used for determining a target sound from all sounds with the target resource acquisition permission;
the first acquisition module is used for acquiring corresponding target resources according to the target resource acquisition permission of the target sound equipment;
the establishing module is used for establishing an access link corresponding to the target resource according to the target resource and the information of the requesting party sound equipment, and returning the access link to the requesting party sound equipment so that the requesting party sound equipment can access the target resource according to the access link.
Optionally, between the receiving module and the first determining module, the apparatus further includes:
a generating module, configured to generate a request event according to the request information, where the request event includes the request information;
the determining module is used for determining the adding position of the request event in the request queue according to the request information and a preset queuing mechanism;
the adding module is used for adding the request event into the request queue according to the adding position;
and the second acquisition module is used for polling all the request events in the request queue and acquiring the request events and the request information from the request queue.
An embodiment of the present invention provides a resource sharing device, including:
a memory for storing a computer program;
a processor for implementing the steps of the resource sharing method as described above when executing the computer program.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the resource sharing method are implemented as described above.
The embodiment of the invention provides a resource sharing method, a device, equipment and a computer readable storage medium, wherein the method comprises the following steps: receiving request information sent by a requesting party sound, wherein the request information comprises target resource information and requesting party sound information; judging whether the requesting party sound equipment has the acquisition authority of the target resource or not according to the request information, if so, acquiring the target resource; if not, determining a target sound from all the sounds with the target resource acquisition authority, and acquiring a corresponding target resource according to the target resource acquisition authority of the target sound; and establishing an access link corresponding to the target resource according to the target resource and the information of the requesting party sound equipment, and returning the access link to the requesting party sound equipment so that the requesting party sound equipment can access the target resource according to the access link.
Therefore, in the application, when a sound of a requesting party needs to access a certain target resource without access authority, a target sound can be determined from all sounds with the target resource access authority, the corresponding target resource is obtained according to the target resource obtaining authority in the target sound, and then an access link related to the target resource is established according to the target resource and the sound information of the requesting party, so that the requesting party obtains the target resource through the access link. The method and the device can ensure the account and information safety of the sharing party sound equipment in the using process, and can also enable the requesting party sound equipment to access resources without permission under the condition of logging in the account, so that the user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed in the prior art and the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic flowchart of a resource sharing method according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating an adding manner of a request event according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a resource sharing device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a resource sharing device according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a resource sharing method, a resource sharing device and a computer readable storage medium, which can not only ensure the account and information security of a sharing party sound box in the using process, but also enable a requesting party sound box to access resources without obtaining authority under the condition of logging in the account, and improve the user experience.
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. 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 invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating a resource sharing method according to an embodiment of the present invention.
The resource sharing method comprises the following steps:
s11: receiving request information sent by a requesting party sound, wherein the request information comprises target resource information and requesting party sound information;
specifically, when the requesting stereo needs to acquire a certain target resource (such as an audio file), request information may be sent to the server, and specifically, the request information may be sent under the operation of the user, where the request information is specifically request information for requesting the target resource, where the target resource information may include an identification code of the target resource, and the requesting stereo information may include an identification code of the requesting stereo.
S12: judging whether the requesting party sound equipment has the acquisition authority of the target resource or not according to the request information, if so, acquiring the target resource, and entering S15; if not, go to S13;
after receiving the request message sent by the requesting party sound, the requesting party sound may be identified and determined according to the requesting party sound message in the request message, specifically according to the identification code of the requesting party sound, and determine whether the requesting party sound has the right to acquire the target resource, and when the requesting party sound has the right to acquire the target resource, the target resource may be directly acquired, and the process proceeds to S15.
When the requesting stereo does not have the acquiring right of the target resource, the process proceeds to S13, which shows that the requesting stereo needs to access the resource without acquiring right, and at this time, a target stereo with the acquiring right of the target resource needs to be found to share the acquiring right of the target resource with the requesting stereo.
S13: determining a target sound from all sounds with target resource acquisition authority;
specifically, when the requesting stereo does not have the right to acquire the target resource, it is necessary to screen out the stereo having the right to acquire the target resource from the other stereo, and determine the target stereo from the stereo, and the target stereo may be specifically determined according to a preset rule.
S14: acquiring corresponding target resources according to the target resource acquisition authority of the target sound;
s15: and establishing an access link corresponding to the target resource according to the target resource and the information of the requesting party sound equipment, and returning the access link to the requesting party sound equipment so that the requesting party sound equipment can access the target resource according to the access link.
Specifically, after the target resource is acquired, an access link corresponding to the target resource may be established according to the target resource and the information of the sound of the requester, and the access link is returned to the sound of the requester, and the sound of the requester may access the target resource according to the access link, where the purpose of establishing the corresponding access link according to the target resource and the information of the sound of the requester is to enable the designated sound to access the target resource through the access link, that is, only the sound matched with the information of the sound of the requester in the access link may access the target resource through the access link, and other sound devices may not access the access link.
It should be further noted that both the requesting stereo and the target stereo are intelligent stereo, wherein the intelligent stereo comprises a microphone array, a loudspeaker, a main control panel, a bluetooth/WiFi module and the like, and the microphone array is composed of a certain number of microphones and is used for sampling and processing the spatial characteristics of a sound field, acquiring a voice signal and delivering the voice signal to a service end for voice recognition; the speaker is used for the broadcast to user's reply information, and the main control board includes mainboard, CPU, memory etc. and the intelligence stereo set needs the server side to distribute and provides most service function, and consequently, the wiFi module is indispensable module, and partial stereo set can communicate with the cell-phone through the bluetooth.
Further, after receiving the request information sent by the requesting stereo at step S11, before determining whether the requesting stereo has the right to acquire the target resource at step S12 according to the request information, the method may further include:
generating a request event according to the request information, wherein the request event comprises the request information;
determining the adding position of the request event in the request queue according to the request information and a preset queuing mechanism;
adding the request event into the request queue according to the adding position;
polling all request events in the request queue, and acquiring the request events and the request information from the request queue.
It should be noted that, since a certain processing time is required in the process of establishing an access link corresponding to a target resource after receiving request information and returning the access link to a requesting party audio, and request information sent by other requesting party audio may also be received in the processing process, a request event corresponding to each request information may be added to a corresponding position of a request queue, and a server performs polling processing on the request events at the positions of the request queue, and when a current request event needs to be processed, the request event and the request information corresponding to the request event are obtained from the request queue.
For example, in the present application, a request event generated according to request information sent by a requestor sound is a request event K, the request information included in the request event K may be requestor sound information, target resource information, and time information initiated by the request event K, and after an adding position of the request event K in a request queue is calculated according to the request information of the request event K and a preset queuing mechanism, the request event K is added to the request queue, which is specifically referred to fig. 2.
Further, the process of determining the adding position of the request event in the request queue according to the request information and the preset queuing mechanism may specifically be:
s21: acquiring parameter information of the requesting party sound according to the request information, wherein the parameter information of the requesting party sound comprises a gain value, a first index value, a resource sharing amount, a sharing proportion and an integral value;
s22: determining the adding position of the request event in the request queue according to the parameter information of the sound of the requesting party and the adding position calculation relational expression;
the added position calculation relationship is:and l ═ max { l',0 }; wherein,α + β + γ ═ 1, and the "others" in the above formula denoteThe case (1); wherein:
l is the adding position of the request event, L is the length of the request queue, a is the gain value of the request side sound, H is the first index value of the request side sound, and H is the sound index value threshold; m is the resource sharing amount of the requesting party ' S stereo, P is the sharing ratio of the requesting party ' S stereo, S is the integral value of the requesting party ' S stereo, M is the stereo sharing amount threshold, P is the stereo sharing ratio threshold, S is the stereo integral value threshold, and α, β, and γ are constants.
In the application, when the adding position of the request event is determined, factors such as a gain value, a first index value, a resource sharing amount, a sharing proportion, an integral value and the like of a requesting side sound device are considered, so that the adding position of the corresponding request event in a request queue is comprehensively considered, and the difference of the adding positions determines whether to perform priority processing on the request event, for example, the request event with the front adding position is processed preferentially in the processing process.
And calculating the relation formula according to the adding position to obtain L, wherein the L is the adding position in the request queue with the length of L, and the corresponding request event can be added into the request queue according to the adding position.
Therefore, in the application, when a sound of a requesting party needs to access a certain target resource without access authority, a target sound can be determined from all sounds with the target resource access authority, the corresponding target resource is obtained according to the target resource obtaining authority in the target sound, and then an access link related to the target resource is established according to the target resource and the sound information of the requesting party, so that the requesting party obtains the target resource through the access link. The method and the device can ensure the account and information safety of the sharing party sound equipment in the using process, and can also enable the requesting party sound equipment to access resources without permission under the condition of logging in the account, so that the user experience is improved.
On the basis of the above embodiments, the present embodiment further describes and optimizes the technical solution, which is specifically as follows:
further, the process of determining the target sound from the sounds having the target resource acquisition right in step S13 may specifically be:
s31: acquiring parameter information of a request event;
s32: and when the parameter information of the request event meets the preset condition, determining each sound equipment with the target resource acquisition authority, and determining the target sound equipment from each sound equipment with the target resource acquisition authority according to a preset rule.
It should be noted that, when selecting a target sound, it is necessary to determine whether the parameter information of the request event satisfies a preset condition, and when the parameter information of the request event satisfies the preset condition, the subsequent process is executed. For example, for a request event with a long processing time or a request event with a large processing frequency, or a sound with a large index value and a large contribution to the past, a suitable target sound is directly found.
Furthermore, the parameter information of the request event in the present application may include an event processing period T, an event modification number N, an integral value s of the sound of the requesting party, the event processing period T, an event modification number threshold N, and an event modification number maximum upper limit value W;
then, in step S32, when the parameter information of the request event satisfies the preset condition, a process of determining each stereo having the target resource acquisition permission and determining the target stereo from the stereo having the target resource acquisition permission according to a preset rule may specifically be:
s321: when N is less than W, judging whether T and N meet T is more than or equal to T or N is more than or equal to N, if yes, entering S322; if not, go to S326;
it should be noted that, when n > W, it is regarded that the sharing operation is failed, 1 is added to the current value of the number of requested event modifications, and only when the number of requested event modifications n is smaller than the maximum upper limit value W of the number of event modifications, the subsequent process is performed.
S322: judging whether a first sound device with a target resource acquisition authority and an authority attribute in a default sharing state exists, if so, entering S323; otherwise, go to S324;
s323: determining each first sound device which has a target resource acquisition authority and the authority attribute of which is in a default sharing state, and randomly selecting one first sound device from the first sound devices as a target sound device;
in order to speed up the processing flow and quickly find out a target sound capable of sharing the target resource acquisition permission, a first sound with the target resource acquisition permission and with the permission attribute in the default sharing state can be preferably selected as the target sound, when the permission attribute of the target sound is in the default sharing state, the target sound is regarded as the target sound which agrees to share the target resource acquisition permission in the default sharing state, and the corresponding target resource acquisition permission can be directly acquired without inquiring the target sound again.
S324: judging whether the target resource acquisition authority exists or not and the authority attribute is in a non-default sharing state, if so, entering S325;
and when the first sound equipment with the target resource acquisition permission and the permission attribute in the default sharing state does not exist, searching whether a second sound equipment with the target resource acquisition permission and the permission attribute in the non-default sharing state exists or not.
S325: determining each second sound which has the target resource acquisition authority and the authority attribute of which is in a non-default sharing state, sequencing the second sounds according to the integral value from large to small, and randomly selecting one second sound from the sequenced second sounds as a target sound;
if there is a second sound device having the target resource acquisition right and the right attribute being in the non-default sharing state, and after each second sound device is determined, the score of each second sound device can be determined according to the score of each second sound deviceSorting the second sounds, specifically, sorting from large to small, intercepting a first preset number of second sounds from a second one of the sorted sequences after sorting, and randomly selecting one second sound from the intercepted first sounds as a target sound, specifically, sorting the second sounds from [0, min { L }, where L is a number of times of the first sounds, where L is a number of times of the second sounds1,l1}]Randomly selecting a second sound as a target sound, wherein L1Number of second speakers with target resource acquisition permission and permission attribute in non-default sharing state, l1Is a first predetermined number.
S326: according to the calculation relationCalculating a second index value H ' of the sound of the requesting party, and judging whether H ' meets the condition that H ' is more than or equal to H, if so, entering S322, otherwise, entering S327; wherein α '+ β' + γ '═ 1, α', β ', and γ' are constants, and H is an acoustic index value threshold;
s327: and determining each second sound which has the target resource acquisition authority and the authority attribute of which is in a non-default sharing state, sequencing the second sounds according to the integral value from large to small, and randomly selecting one sound from the preset number of second sounds as the target sound.
Specifically, after the second sounds having the target resource acquisition authority and the authority attribute in the non-default sharing state are determined, the second sounds are sorted according to integral values respectively corresponding to the second sounds, the second sounds can be sorted from large to small according to the integral values, a second preset number of second sounds are intercepted from a first second sound after sorting, and one second sound is randomly selected from the second preset number of second sounds to serve as the target sound.
For example, can be selected fromRandomly selecting a second sound as a target sound, wherein L1Obtain rights for a target resource and have a rights attribute ofA number of second speakers that are not in a default sharing state.
If there is no sound with the target resource acquisition authority in other sounds, the process is ended, and a prompt message of sharing failure is returned to the sound of the requester, and the reason of sharing failure can also be returned.
Further, the process of acquiring the corresponding target resource according to the target resource acquisition authority of the target sound device comprises:
acquiring authority according to target resources of the target sound to acquire authority attributes of the target sound;
when the authority attribute of the target sound equipment is in a default sharing state, directly acquiring target resources;
it should be noted that, for a target sound with an authority attribute in a default sharing state, it is indicated that the target sound can be defaulted to allow the resource to be shared to obtain the authority without inquiring the target sound, at this time, the target resource can be directly obtained, an access link corresponding to the target resource is established according to the target resource and the information of the requesting sound, and the access link is returned to the requesting sound, so that the requesting sound accesses the target resource according to the access link.
And when the authority attribute of the target sound is in a non-default sharing state, sending an inquiry request to the target sound, and acquiring the target resource according to a sharing permission reply returned by the target sound.
It can be understood that, for a target sound device whose authority attribute is in a non-default sharing state, an inquiry request needs to be sent to the target sound device, where the inquiry request may include information such as requester sound information and target resource information, and after receiving the inquiry request, the target sound device may determine whether to allow the acquisition authority to share the target resource according to the requester sound information and the target resource information in the inquiry request, and return reply information to the server, and the server may acquire the target resource only after receiving a sharing permission reply returned by the target sound device. And if the server receives a non-permission sharing reply returned by the target sound, the sharing is failed, one second sound can be selected from other second sounds again to serve as the target sound, a corresponding inquiry request is initiated until the permission sharing reply is received, the target resource is obtained, an access link corresponding to the target resource is established according to the target resource and the sound information of the requester, and the access link is returned to the requester sound so that the requester can access the target resource according to the access link.
It should be further noted that, when the server sends an inquiry request to the target audio, a wait-to-reply event may be generated at the same time, and the wait-to-reply event is added to the wait-to-reply queue, at this time, the inquiry request may further include information such as an identification code of the wait-to-reply event, and the wait-to-reply event may include information such as requester audio information, target resource information, corresponding request event initiation time, and the number of times of modification of the wait-to-reply event.
After receiving the inquiry request, the target sound determines whether to obtain the authority of sharing the target resource with the requesting sound, and replies reply information to the server, wherein the reply information comprises information such as an identification code of a waiting reply event. After receiving a reply which allows sharing authority and is returned by a target sound, a server acquires a waiting reply event from a waiting reply queue according to an identification code of the waiting reply event in reply information, acquires a target resource according to a target resource acquisition authority, creates an access link of the target resource under a shared directory of the target sound, and returns the access link to a requesting sound, and can also modify the point condition of the target sound according to a first point modification rule, wherein the first point modification rule is as follows:
where s is the integral value of the sound, T' is the event recovery period threshold, and a is the gain value.
If the server receives a reply that the shared resource acquisition permission is not allowed or the target sound device does not reply within the limited time, the target sound device is considered to be not allowed to share the acquisition permission of the target resource, and the integral value of the target sound device can be modified at the moment, and particularly the integral value of the target sound device can be modified according to a second integral modification rule. The server needs to reselect the target sound and initiate an inquiry request, and modify the target sound information in the event waiting for reply and the number of times of modification of the event waiting for reply, wherein the target sound is still selected according to the method.
Wherein the second integral modification rule is as follows:
s ═ max { S-b, S }, where b is the loss value, S is the acoustic integral value threshold, and S is the acoustic integral value.
In addition, it should be noted that each stereo may also check each waiting reply event in the waiting reply queue, and when the waiting reply event including the target resource information is found and the stereo itself has the target resource acquisition right, may actively send feedback information that allows the acquisition right to the server. In addition, after the target sound equipment acquires the authority for sharing the target resource by the requesting sound equipment, the target sound equipment can also send a notification for canceling the acquisition authority for sharing the target resource by the requesting sound equipment to the server side at any time by checking the shared directory of the target sound equipment so as to finish the sharing.
The method and the device can ensure the safety of information such as the account and the password of the target sound equipment, avoid the damage to the target sound equipment (sharing party) caused by the process of acquiring the authority by sharing resources, and shield the sharing party from the sound of the requesting party, so that the information of the sharing party is more private. In addition, the requesting party can acquire the resource without the acquisition permission under the condition of logging in the current account, and the user experience is greatly improved.
Correspondingly, the embodiment of the invention also discloses a resource sharing device, and particularly refers to fig. 2. On the basis of the above-described embodiment:
the resource sharing apparatus includes:
the receiving module 11 is configured to receive request information sent by a sound of a requester, where the request information includes target resource information and the sound information of the requester;
the first judging module 12 is configured to judge whether the requesting stereo has the right to acquire the target resource according to the request information, and if yes, acquire the target resource and trigger the establishing module 15; if not, triggering the selection module 13;
the selection module 13 is configured to determine a target sound from the sounds having the target resource acquisition right;
the first obtaining module 14 is configured to obtain a corresponding target resource according to a target resource obtaining authority of the target sound;
and the establishing module 15 is used for establishing an access link corresponding to the target resource according to the target resource and the information of the requesting party sound equipment, and returning the access link to the requesting party sound equipment so that the requesting party sound equipment can access the target resource according to the access link.
Optionally, between the receiving module 11 and the first judging module 12, the apparatus further includes:
the generating module is used for generating a request event according to the request information, and the request event comprises the request information;
the determining module is used for determining the adding position of the request event in the request queue according to the request information and a preset queuing mechanism;
the adding module is used for adding the request event into the request queue according to the adding position;
and the second acquisition module is used for polling all the request events in the request queue and acquiring the request events and the request information from the request queue.
On the basis of the foregoing embodiment, an embodiment of the present invention provides a resource sharing device, including:
a memory 21 for storing a computer program;
a processor 22 for implementing the steps of the resource sharing method as described above when executing the computer program.
On the basis of the foregoing embodiments, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the resource sharing method are implemented.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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 identical elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (8)
1. A method for resource sharing, comprising:
s11: receiving request information sent by a requesting party sound, wherein the request information comprises target resource information and requesting party sound information;
s12: judging whether the sound of the requesting party has the acquisition authority of the target resource or not according to the request information, if so, acquiring the target resource, and entering S15; if not, go to S13;
after receiving request information sent by a requesting party sound, before judging whether the requesting party sound has the acquisition authority of a target resource according to the request information, generating a request event according to the request information, wherein the request event comprises the request information; acquiring parameter information of the requesting party sound according to the request information, wherein the parameter information of the requesting party sound comprises a gain value, a first index value, a resource sharing amount, a sharing proportion and an integral value; determining the adding position of the request event in a request queue according to the parameter information of the sound of the requesting party and the adding position calculation relational expression;
s13: determining a target sound from all sounds with the target resource acquisition authority; the process of determining the target sound from the sounds with the target resource acquisition authority comprises the following steps: acquiring parameter information of the request event, wherein the parameter information comprises an event processing period T, an event modification frequency N, an integral value s of a sound of a requesting party, the event processing period T, an event modification frequency threshold N and an event modification frequency maximum upper limit value W; s321: when N is less than W, judging whether T and N meet T is more than or equal to T or N is more than or equal to N, if yes, entering S322; if not, go to S326; s322: judging whether a first sound device with the target resource acquisition authority and the authority attribute in a default sharing state exists, if so, entering S323; otherwise, go to S324; s323: determining each first sound device with the target resource acquisition permission and the permission attribute in a default sharing state, and randomly selecting one first sound device from the first sound devices as a target sound device; s324: judging whether the target resource acquisition permission exists or not and the permission attribute is in a non-default sharing state, if so, entering S325; s325: determining each second sound device which has the target resource acquisition authority and the authority attribute of which is in the non-default sharing state, sequencing the second sound devices according to the integral value from large to small, and randomly selecting one second sound device from the sequenced second sound devices as a targetMarking sound equipment; s326: according to the calculation relationCalculating a second index value H ' of the sound of the requesting party, and judging whether H ' meets the condition that H ' is more than or equal to H, wherein H is a sound index value threshold, if so, entering S322, and if not, entering S327; wherein α '+ β' + γ '═ 1, α', β ', and γ' are all constants; s327: determining each second sound device which has the target resource acquisition authority and the authority attribute of which is in a non-default sharing state, sequencing the second sound devices according to the integral value from large to small, and randomly selecting one sound device from a preset number of second sound devices as a target sound device;
s14: acquiring corresponding target resources according to the target resource acquisition authority of the target sound equipment;
s15: and establishing an access link corresponding to the target resource according to the target resource and the information of the requesting party sound equipment, and returning the access link to the requesting party sound equipment so that the requesting party sound equipment can access the target resource according to the access link.
2. The resource sharing method according to claim 1, wherein after receiving request information sent by the requesting party, before said determining whether the requesting party has the right to acquire the target resource according to the request information, the method further comprises:
adding the request event to the request queue according to the adding position;
polling all request events in the request queue, and acquiring the request events and the request information from the request queue.
3. The resource sharing method according to claim 1,
the adding position calculation relational expression is as follows:and l ═ max { l',0 }; wherein,α + β + γ ═ 1; wherein:
l is the adding position of the request event, L is the length of a request queue, a is the gain value of the request party sound, H is the first index value of the request party sound, and H is the sound index value threshold; m is the resource sharing amount of the requesting party ' S stereo, P is the sharing ratio of the requesting party ' S stereo, S is the integral value of the requesting party ' S stereo, M is the stereo sharing amount threshold, P is the stereo sharing ratio threshold, S is the stereo integral value threshold, and α, β, and γ are constants.
4. The resource sharing method according to claim 1, wherein the process of acquiring the corresponding target resource according to the target resource acquisition authority of the target sound device comprises:
acquiring authority attribute of the target sound according to the target resource acquisition authority of the target sound;
when the authority attribute of the target sound equipment is in a default sharing state, directly acquiring the target resource;
and when the authority attribute of the target sound is in a non-default sharing state, sending an inquiry request to the target sound, and acquiring the target resource according to an allowed sharing reply returned by the target sound.
5. A resource sharing apparatus, comprising:
the system comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for receiving request information sent by a sound of a requesting party, and the request information comprises target resource information and sound information of the requesting party;
the first judgment module is used for judging whether the sound of the requester has the acquisition authority of the target resource or not according to the request information, if so, the target resource is acquired, and the establishment module is triggered; if not, triggering a selection module;
between the receiving module and the first judging module, the apparatus includes: a generating module, configured to generate a request event according to the request information, where the request event includes the request information; acquiring parameter information of the requesting party sound according to the request information, wherein the parameter information of the requesting party sound comprises a gain value, a first index value, a resource sharing amount, a sharing proportion and an integral value; the determining module is used for determining the adding position of the request event in the request queue according to the request information and a preset queuing mechanism;
the selection module is used for determining a target sound from all sounds with the target resource acquisition permission; the process of determining the target sound from the sounds with the target resource acquisition authority comprises the following steps: acquiring parameter information of the request event, wherein the parameter information comprises an event processing period T, an event modification frequency N, an integral value s of a sound of a requesting party, the event processing period T, an event modification frequency threshold N and an event modification frequency maximum upper limit value W; s321: when N is less than W, judging whether T and N meet T is more than or equal to T or N is more than or equal to N, if yes, entering S322; if not, go to S326; s322: judging whether a first sound device with the target resource acquisition authority and the authority attribute in a default sharing state exists, if so, entering S323; otherwise, go to S324; s323: determining each first sound device with the target resource acquisition permission and the permission attribute in a default sharing state, and randomly selecting one first sound device from the first sound devices as a target sound device; s324: judging whether the target resource acquisition permission exists or not and the permission attribute is in a non-default sharing state, if so, entering S325; s325: determining each second sound which has the target resource acquisition authority and the authority attribute of which is in a non-default sharing state, sequencing the second sounds according to the integral value from large to small, and randomly selecting one second sound from the sequenced second sounds as a target sound; s326: according to the calculation relationCalculating a second index value H ' of the sound of the requesting party, and judging whether H ' satisfies H ' being more than or equal to H, wherein H is soundIf yes, entering S322, otherwise, entering S327; wherein α '+ β' + γ '═ 1, α', β ', and γ' are all constants; s327: determining each second sound device which has the target resource acquisition authority and the authority attribute of which is in a non-default sharing state, sequencing the second sound devices according to the integral value from large to small, and randomly selecting one sound device from a preset number of second sound devices as a target sound device;
the first acquisition module is used for acquiring corresponding target resources according to the target resource acquisition permission of the target sound equipment;
the establishing module is used for establishing an access link corresponding to the target resource according to the target resource and the information of the requesting party sound equipment, and returning the access link to the requesting party sound equipment so that the requesting party sound equipment can access the target resource according to the access link.
6. The resource sharing apparatus according to claim 5, wherein between the receiving module and the first determining module, the apparatus further comprises: the adding module is used for adding the request event into the request queue according to the adding position;
and the second acquisition module is used for polling all the request events in the request queue and acquiring the request events and the request information from the request queue.
7. A resource sharing device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the resource sharing method according to any one of claims 1 to 4 when executing the computer program.
8. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the resource sharing method according to any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810877759.6A CN109246080B (en) | 2018-08-03 | 2018-08-03 | Resource sharing method, device, equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810877759.6A CN109246080B (en) | 2018-08-03 | 2018-08-03 | Resource sharing method, device, equipment and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109246080A CN109246080A (en) | 2019-01-18 |
CN109246080B true CN109246080B (en) | 2021-08-27 |
Family
ID=65070190
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810877759.6A Active CN109246080B (en) | 2018-08-03 | 2018-08-03 | Resource sharing method, device, equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109246080B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113079555B (en) * | 2019-04-22 | 2022-11-15 | Oppo广东移动通信有限公司 | Network resource sharing method and related device |
CN110602068B (en) * | 2019-08-29 | 2022-08-09 | 深圳市新系区块链技术有限公司 | Data authority management method and related product |
WO2021035708A1 (en) * | 2019-08-30 | 2021-03-04 | Oppo广东移动通信有限公司 | Method and apparatus for accessing collection resources, device and storage medium |
CN113179197B (en) * | 2021-03-02 | 2022-11-04 | 广州朗国电子科技股份有限公司 | Household appliance resource sharing method, household appliance resource sharing device and storage device |
CN115277273B (en) * | 2022-07-25 | 2024-03-22 | 维沃移动通信有限公司 | Resource sharing method and resource sharing device |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101150419A (en) * | 2007-11-12 | 2008-03-26 | 中国电信股份有限公司 | A new generation call center system and automatic service realization method |
US7587310B2 (en) * | 2004-08-30 | 2009-09-08 | Lsi Corporation | Sound processor architecture using single port memory unit |
CN101807264A (en) * | 2009-02-18 | 2010-08-18 | 深圳市华信智能科技有限公司 | Client service reservation method |
CN102137158A (en) * | 2011-03-10 | 2011-07-27 | 西北工业大学 | Method for sharing information equipment resources by utilizing equipment agent system |
CN105162715A (en) * | 2006-03-01 | 2015-12-16 | 卢森特技术有限公司 | System and method for prioritizing session initiation protocol messages |
CN105185391A (en) * | 2015-08-27 | 2015-12-23 | 三星电子(中国)研发中心 | Method and device for multi-user sound box control |
CN106506550A (en) * | 2016-12-27 | 2017-03-15 | Tcl集团股份有限公司 | A kind of shared method and apparatus of smart machine control authority |
CN106685978A (en) * | 2017-01-04 | 2017-05-17 | 北京奇虎科技有限公司 | Method and apparatus of controlling access permission among multi devices, and mobile terminal |
CN107347039A (en) * | 2016-05-05 | 2017-11-14 | 深圳市中兴微电子技术有限公司 | A kind of management method and device in shared buffer memory space |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9985950B2 (en) * | 2006-08-09 | 2018-05-29 | Assa Abloy Ab | Method and apparatus for making a decision on a card |
JP5783246B2 (en) * | 2011-03-19 | 2015-09-24 | 富士通株式会社 | Terminal device, process management method, and process management program |
US10134374B2 (en) * | 2016-11-02 | 2018-11-20 | Yamaha Corporation | Signal processing method and signal processing apparatus |
-
2018
- 2018-08-03 CN CN201810877759.6A patent/CN109246080B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7587310B2 (en) * | 2004-08-30 | 2009-09-08 | Lsi Corporation | Sound processor architecture using single port memory unit |
CN105162715A (en) * | 2006-03-01 | 2015-12-16 | 卢森特技术有限公司 | System and method for prioritizing session initiation protocol messages |
CN101150419A (en) * | 2007-11-12 | 2008-03-26 | 中国电信股份有限公司 | A new generation call center system and automatic service realization method |
CN101807264A (en) * | 2009-02-18 | 2010-08-18 | 深圳市华信智能科技有限公司 | Client service reservation method |
CN102137158A (en) * | 2011-03-10 | 2011-07-27 | 西北工业大学 | Method for sharing information equipment resources by utilizing equipment agent system |
CN105185391A (en) * | 2015-08-27 | 2015-12-23 | 三星电子(中国)研发中心 | Method and device for multi-user sound box control |
CN107347039A (en) * | 2016-05-05 | 2017-11-14 | 深圳市中兴微电子技术有限公司 | A kind of management method and device in shared buffer memory space |
CN106506550A (en) * | 2016-12-27 | 2017-03-15 | Tcl集团股份有限公司 | A kind of shared method and apparatus of smart machine control authority |
CN106685978A (en) * | 2017-01-04 | 2017-05-17 | 北京奇虎科技有限公司 | Method and apparatus of controlling access permission among multi devices, and mobile terminal |
Non-Patent Citations (2)
Title |
---|
A Fair and Efficient Resource Allocation Scheme for Multi-Server Distributed Systems and Networks;Peyman Teymoori;《IEEE TRANSACTIONS ON MOBILE COMPUTING》;IEEE;20151006;全文 * |
语音端点检测在实时语音截取中的应用;洪奕鑫;《无线互联科技》;20171205;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN109246080A (en) | 2019-01-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109246080B (en) | Resource sharing method, device, equipment and computer readable storage medium | |
US20220030082A1 (en) | Methods, systems, and media for managing notifications directed to multiple applications installed on a user device | |
CN107360064B (en) | Intelligent device sharing method and device and computer readable storage medium | |
US10705789B2 (en) | Dynamic volume adjustment for virtual assistants | |
CN109313897A (en) | Utilize the communication of multiple virtual assistant services | |
CN104346548A (en) | Wearable equipment and authentication method thereof | |
CN110097884B (en) | Voice interaction method and device | |
CN110944035A (en) | Internet of things equipment control method and system and readable medium | |
CN107294910B (en) | Login method and server | |
CN110856086A (en) | Method and device for controlling sound system and readable storage medium | |
CN107979830A (en) | A kind of Bluetooth connecting method, device, equipment and the storage medium of intelligent back vision mirror | |
CN107181825B (en) | Online processing method of terminal equipment data | |
CN112948804B (en) | Program control method, device and computer readable storage medium | |
WO2022105365A1 (en) | Device control method and system, electronic device, and storage medium | |
CN112751734A (en) | Household appliance control method based on cleaning robot, cleaning robot and chip | |
CN107644265B (en) | Reservation method, device and system for shared object and server | |
CN109474596B (en) | Token-based resource sharing method for intelligent loudspeaker box | |
CN109660988B (en) | Communication authentication processing method and device and electronic equipment | |
CN108962259B (en) | Processing method and first electronic device | |
JP5658341B1 (en) | Information processing system, program, and information processing method. | |
CN115734206A (en) | Vehicle-mounted machine Bluetooth connection method and device, electronic equipment, storage medium and vehicle | |
CN103873682B (en) | A kind of information processing method and electronic equipment | |
JP4735972B2 (en) | Information distribution system, user device, and information distribution method | |
CN112883309B (en) | Method, device, equipment and medium for accessing application through browser | |
CN106210100A (en) | A kind of service recourse method and system |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |