CN111464826B - List updating method and device for virtual resources, electronic equipment and storage medium - Google Patents

List updating method and device for virtual resources, electronic equipment and storage medium Download PDF

Info

Publication number
CN111464826B
CN111464826B CN202010292389.7A CN202010292389A CN111464826B CN 111464826 B CN111464826 B CN 111464826B CN 202010292389 A CN202010292389 A CN 202010292389A CN 111464826 B CN111464826 B CN 111464826B
Authority
CN
China
Prior art keywords
virtual resource
distributed data
record
list
target user
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
Application number
CN202010292389.7A
Other languages
Chinese (zh)
Other versions
CN111464826A (en
Inventor
段勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202010292389.7A priority Critical patent/CN111464826B/en
Publication of CN111464826A publication Critical patent/CN111464826A/en
Application granted granted Critical
Publication of CN111464826B publication Critical patent/CN111464826B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • H04N21/26291Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists for providing content or additional data updates, e.g. updating software modules, stored at the client
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB
    • H04N21/4431OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB characterized by the use of Application Program Interface [API] libraries

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Library & Information Science (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure relates to a list updating method and device of virtual resources, electronic equipment and a storage medium, and relates to the field of live broadcast. The method comprises the following steps: receiving a virtual resource change request sent by a user side, wherein the virtual resource change request carries a target user identifier and a corresponding virtual resource change amount; searching a target distributed data table to which the target user identification belongs in a plurality of distributed data tables according to the target user identification, wherein the plurality of distributed data tables are used for storing each user identification and corresponding virtual resource allowance in a distributed mode; updating the virtual resource allowance corresponding to the target user identification in the target distributed data table according to the target user identification and the corresponding virtual resource change amount; respectively pulling records of a preset number before the virtual resource allowance ranking from the plurality of distributed data tables; updating the global virtual resource list based on the pulled record. According to the embodiment of the disclosure, timely update of the list can be ensured.

Description

List updating method and device for virtual resources, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of live broadcast, and in particular, to a list updating method and apparatus for virtual resources, an electronic device, and a storage medium.
Background
With the growing maturity of live webcasting, virtual resources are widely applied to various live webcasting platforms, and users in a live webcasting room can generate virtual resources, such as virtual gifts, pet rations of virtual pets, and the like, through behaviors of watching live webcasting, making comments in the live webcasting room, and the like.
In the related art, in order to improve the activity of users in a live broadcasting room, a display entry of a user virtual resource remaining list is often provided in a live broadcasting service, the remaining amounts of virtual resources are arranged in an inverted order, and a plurality of users with the top-ranked remaining amounts of virtual resources are displayed in the live broadcasting room. When a user produces or consumes a virtual resource, the leaderboard is updated according to the number of producing or consuming virtual resources.
For some popular live broadcast rooms, a large amount of list data may exist, so that when the list is updated, the list of the virtual resources may not be updated in time due to massive calculation, and the use experience of a user is affected.
Disclosure of Invention
The disclosure provides a list updating method and device for virtual resources and electronic equipment, and aims to at least solve the problem that lists of virtual resources cannot be updated in time in the related art.
The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, a list updating method for a virtual resource is provided, including:
receiving a virtual resource change request sent by a user side, wherein the virtual resource change request carries a target user identifier and a corresponding virtual resource change amount;
searching a target distributed data table to which the target user identification belongs in a plurality of distributed data tables according to the target user identification, wherein the plurality of distributed data tables are used for storing each user identification and corresponding virtual resource allowance in a distributed mode;
updating the virtual resource allowance corresponding to the target user identification in the target distributed data table according to the target user identification and the corresponding virtual resource change amount;
respectively pulling records of a preset number before the virtual resource allowance ranking from the plurality of distributed data tables;
updating a global virtual resource list based on the pulled records, wherein the global virtual resource list is generated according to the records of the preset number of the virtual resource allowance ranking pulled from the plurality of distributed data tables at the last time.
Optionally, the updating, in the target distributed data table, the virtual resource allowance corresponding to the target user identifier according to the target user identifier and the corresponding virtual resource change amount includes:
when a record with the user identification being the same as the target user identification exists in the target distributed data table, updating the virtual resource allowance recorded in the same record according to the virtual resource change amount;
and when no record with the user identification same as the target user identification exists in the target distributed data table, taking the virtual resource change amount as the virtual resource allowance corresponding to the target user identification, and writing a new record in the target distributed data table according to the target user identification and the corresponding virtual resource allowance.
Optionally, after the records of the preset number of virtual resource allowance rankings are respectively pulled from the multiple distributed data tables, the method further includes:
updating the records in the global ordered list according to the pulled records;
the updating of the global virtual resource list based on the pulled record includes:
and comparing the updated record of the preset number before the virtual resource residue balance ranking in the global ordered list with the record in the global virtual resource list, and updating the global virtual resource list according to the record of the preset number before the virtual resource residue balance ranking in the global ordered list when the record of the preset number before the virtual resource residue balance ranking in the global ordered list is inconsistent with the record in the global virtual resource list.
Optionally, the respectively pulling records of a preset number of virtual resource allowance rankings from the multiple distributed data tables includes:
and respectively pulling records of a preset number before the virtual resource allowance ranking from the plurality of distributed data tables at preset time intervals.
Optionally, the method further includes:
after the virtual resource allowance corresponding to the target user identification is updated, deleting the record with the virtual resource allowance of zero; or
And deleting the records with zero virtual resource allowance in the plurality of distributed data tables at regular time.
According to a second aspect of the embodiments of the present disclosure, there is provided a list updating apparatus for a virtual resource, including:
the system comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is configured to execute a virtual resource change request sent by a receiving user side, and the virtual resource change request carries a target user identifier and a corresponding virtual resource change amount;
the searching unit is configured to search a target distributed data table to which the target user identifier belongs in a plurality of distributed data tables according to the target user identifier, wherein the plurality of distributed data tables are used for storing each user identifier and corresponding virtual resource allowance in a distributed manner;
a first updating unit, configured to update the virtual resource allowance corresponding to the target user identifier in the target distributed data table according to the target user identifier and the corresponding virtual resource change amount;
a pulling unit configured to perform pulling of records of a preset number of virtual resource allowance ranks from the plurality of distributed data tables, respectively;
a second updating unit configured to perform updating of a global virtual resource list based on the pulled records, wherein the global virtual resource list is generated according to a record of a preset number of top virtual resource allowance ranks pulled from the plurality of distributed data tables last time.
Optionally, the list updating apparatus for virtual resources further includes:
a judging unit configured to perform judgment on whether a record with a user identifier identical to the target user identifier exists in the target distributed data table;
the first updating unit is configured to update the virtual resource allowance recorded in the same record according to the virtual resource change amount when a record with the same user identifier as the target user identifier exists in the target distributed data table; and
and when no record with the same user identifier as the target user identifier exists in the target distributed data table, taking the virtual resource change amount as the virtual resource allowance corresponding to the target user identifier, and writing a new record in the target distributed data table according to the target user identifier and the corresponding virtual resource allowance.
Optionally, the list updating apparatus for virtual resources further includes:
a third updating unit configured to perform updating of the records in the global ordered list according to the pulled records;
the second updating unit is configured to compare the updated record of the preset number before the virtual resource residue balance ranking in the global ordered list with the record in the global virtual resource list, and update the global virtual resource list according to the record of the preset number before the virtual resource residue balance ranking in the global ordered list when the record of the preset number before the virtual resource residue balance ranking in the global ordered list is inconsistent with the record in the global virtual resource list.
Optionally, the list updating apparatus for virtual resources further includes:
a deleting unit configured to delete a record of which the virtual resource margin is zero after updating the virtual resource margin corresponding to the target user identifier; or
And deleting the records with zero virtual resource allowance in the plurality of distributed data tables at regular time.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the list update method for virtual resources as described above.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a storage medium, wherein when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the list updating method for virtual resources as described above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
the target distributed data table to which the target user identification belongs is searched in the distributed data tables according to the target user identification in the change request, the virtual resource allowance corresponding to the target user identification is updated in the target distributed data table according to the target user identification and the corresponding virtual resource change amount, and when the list is updated, the update of the global virtual resource list can be completed conveniently according to the record of the preset number before the virtual resource allowance ranking is pulled from the distributed data tables, so that the calculation amount during the list update is greatly reduced, and the list is ensured to be updated timely.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
Fig. 1 is a schematic diagram illustrating an application environment of a list updating method, apparatus, electronic device and storage medium for a virtual resource according to an exemplary embodiment.
FIG. 2 is a flow diagram illustrating a method for list update of a virtual resource, according to an example embodiment.
Fig. 3 is a flowchart illustrating updating of virtual resource margins corresponding to target subscriber identities in a target distributed data table according to an exemplary embodiment.
Fig. 4 is a block diagram illustrating a listing update apparatus for a virtual resource, according to an example embodiment.
FIG. 5 is a block diagram of an electronic device shown in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in other sequences than those illustrated or described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
In order to solve the problems in the related art, the present disclosure provides a list updating method and apparatus for a virtual resource, an electronic device, and a storage medium. The method, the device, the electronic equipment and the storage medium can improve the update speed of the list when the virtual resource list between the live broadcasts is updated.
First, in order to more intuitively understand the scheme provided by the embodiment of the present disclosure, a system architecture of the list update scheme of the virtual resource provided by the embodiment of the present disclosure is described below with reference to fig. 1.
Fig. 1 is a schematic application environment diagram of a list updating method and apparatus for a virtual resource, an electronic device, and a storage medium according to one or more embodiments of the present disclosure. As shown in fig. 1, one or more user terminals 200 establish a communication connection with the live broadcast server 100 through the network 300, the live broadcast server 100 can push the live broadcast content of the main broadcast terminal to the user terminals 200 so that the users of the user terminals 200 can watch the live broadcast, the live broadcast server 100 records the virtual resource allowance of the users watching the live broadcast in the live broadcast room, and generates a list of virtual resources according to the related information of the users with the virtual resource allowance at the top of the ranking, and displays the list to the audience.
The ue 200 may complete a specific task by requesting an Application Programming Interface (API) service to generate a virtual resource, and may consume the virtual resource by requesting the API service. In this process, the live broadcast server 100 may update the list of the virtual resources according to the generation and consumption conditions of the virtual resources, so as to promote more interactions of the user in the live broadcast watching process, thereby increasing the user activity of the live broadcast platform.
The user end 200 may be, but is not limited to, a personal computer, a smart phone, a tablet computer, and the like, and the network 300 may be a wired or wireless network.
The list updating method for the virtual resource provided by the embodiment of the present disclosure will be described in detail below.
The list updating method for the virtual resource provided by the embodiment of the present disclosure can be applied to the live broadcast server 100, and for convenience of description, except for special description, the embodiment of the present disclosure takes the live broadcast server 100 as an execution subject for description.
It is to be understood that the subject matter described herein is not to be construed as limiting the embodiments of the disclosure.
Specifically, the process of the list updating method for virtual resources is shown in fig. 2, and may include the following steps:
in step S21, a virtual resource change request transmitted by the user side is received.
The virtual resource change request may be generated based on the user side 200 requesting the API service to complete a specific task, or may be generated based on the user side 200 requesting the API service to consume the virtual resource.
The virtual resource change request carries a target user identifier and a corresponding virtual resource change amount, the target user identifier may be a user ID or other characters (such as a physical address of the user terminal 200) uniquely identifying the user, and the virtual resource change amount may be a positive number or a negative number for different change requests.
In an embodiment of the present disclosure, when the virtual resource change request is generated based on the ue 200 requesting the API service to complete a specific task, the virtual resource change amount carried in the virtual resource change request may be a positive number. When the virtual resource change request is based on the API service requested by the ue 200 to consume the virtual resource, the virtual resource change amount carried in the virtual resource change request may be a negative number.
The virtual resource may be the number of gifts of the audience users in the live broadcast room, the pet ration of live pets, etc. For example, when the virtual resource is a pet ration of a live pet in a live broadcast room, the audience user may request the API service at the user terminal 200 to complete a certain task (such as agreeing, leaving a message, etc.) of generating the ration, and at this time, the user terminal 200 sends a virtual resource change request to the live broadcast server 100, where a virtual resource change amount carried in the virtual resource change request is a positive number. The audience user can also feed the ration to the live pet by requesting the API service at the user end 200, and at this time, the user end 200 sends a virtual resource change request to the live server 100, where the virtual resource change amount carried in the virtual resource change request is a negative number.
In step S22, according to the target user identifier, the target distributed data table to which the target user identifier belongs is searched in the plurality of distributed data tables.
The live broadcast server 100 may set a plurality of distributed data tables in a fragmentation (sharing) manner, where each distributed data table stores a plurality of records, and each record has a user identifier and a corresponding virtual resource margin.
When the record is stored in the distributed data table, the record may be stored according to a predefined rule based on the user identifier in the record, for example, the record may be stored in segments according to the value size corresponding to the user identifier, or the record may be determined by performing remainder operation on the number of the distributed data table according to the value corresponding to the user identifier.
After receiving a virtual resource change request sent by a user, the live broadcast server 100 can find a target distributed data table to which a target user identifier belongs from a plurality of distributed data tables according to the target user identifier carried in the virtual resource change request.
For example, in one embodiment, the live broadcast server 100 is provided with 100 distributed data tables, the target user in a certain record is identified as 10047, the 100 may be subjected to the remainder operation by 10047, the obtained result is 47, and at this time, the record may be stored in the 47 th distributed data table.
In step S23, the virtual resource remaining amount corresponding to the target user id is updated in the target distributed data table according to the target user id and the corresponding virtual resource change amount.
The virtual resource allowance corresponding to the updated user identifier can be divided into two cases, wherein one case is that a record with the user identifier being the same as the target user identifier exists in the target distributed data table, and the other case is that a record with the user identifier being the same as the target user identifier does not exist in the target distributed data table.
Specifically, referring to fig. 3, updating the virtual resource margin corresponding to the target user identifier in the target distributed data table may include the following steps:
in step S231, it is determined whether a record exists in the target distributed data table, where the record includes a user identifier that is the same as the target user identifier, and if so, step S232 is executed; if not, step S233 is performed.
In step S232, the virtual resource remaining amount recorded in the same record is updated in accordance with the virtual resource change amount.
If a record with the same user identifier as the target user identifier exists in the target distributed data table, the virtual resource change amount can be directly added to the virtual resource allowance recorded in the record, and the added value is used as the virtual resource allowance recorded in the record.
For example, if the value corresponding to the virtual resource change amount is 1 and the virtual resource remaining amount recorded in the record is 2, the value corresponding to the virtual resource remaining amount recorded in the record after the update is 3.
In step S233, the virtual resource change amount is used as the virtual resource margin corresponding to the target user identifier, and a new record is written in the target distributed data table according to the target user identifier and the corresponding virtual resource margin.
If the target distributed data table does not have a record with the user identifier being the same as the target user identifier, the virtual resource change amount can be used as the virtual resource allowance corresponding to the target user identifier, and the target user identifier and the corresponding virtual resource allowance are used as a new record to be written into the target distributed data table. When writing a new record into the target distributed data table, the corresponding target distributed data table can be found according to a predefined rule, and then the new record is written into the found target distributed data table. For example, the corresponding target distributed data table is found by a remainder operation manner as described above, or the corresponding target distributed data table is found according to a numerical value corresponding to the user identifier as described above.
In one disclosed embodiment, after the virtual resource allowance corresponding to the target user identifier is updated, the record with the virtual resource allowance being zero may be deleted, or the record with the virtual resource allowance being zero in the multiple distributed data tables may be deleted at regular time, so that the data volume of the distributed data tables may be reduced, accumulation of dirty data is avoided, the data computation amount is reduced, and the list updating speed of the virtual resource is increased.
In step S24, a record of a preset number of virtual resource headroom ranks is pulled from each of the plurality of distributed data tables.
In one embodiment of the present disclosure, a record of a preset number of virtual resource headroom ranks may be pulled from the plurality of distributed data tables, respectively, at preset time intervals.
The time interval of pulling and the number of pulling from each distributed data table can be set according to actual conditions, for example, every 1 second, the top 10 records of the virtual resource margin ranking are pulled from each distributed data table.
In one embodiment, the records pulled by the live broadcast server 100 may be stored in a global ordered list, and after a preset number of records before the virtual resource allowance ranking are pulled from the plurality of distributed data tables, the records in the global ordered list may be updated according to the pulled records, that is, the pulled records replace the last pulled records.
In step S25, the global virtual resource list is updated based on the pulled record.
The global virtual resource list is generated according to records of a preset number of virtual resource allowance ranks pulled from the distributed data tables last time, and the global virtual resource list records a plurality of records of virtual resource allowance ranks in the global ordered list. After the records of the preset number before the virtual resource allowance ranking are pulled from the distributed data tables and stored in the global ordered list, the records before the virtual resource allowance ranking can be selected from the global ordered list to update the global virtual resource list.
When the global virtual resource list is updated, the record of the preset number before the virtual resource residue ranking in the updated global ordered list may be compared with the record in the global virtual resource list, and when the record of the preset number before the virtual resource residue ranking in the global ordered list is inconsistent with the record in the global virtual resource list, the global virtual resource list is updated according to the record of the preset number before the virtual resource residue ranking in the global ordered list. Specifically, the records of the preset number before the virtual resource residue ranking in the global ordered list may be compared with the records in the global virtual resource list one by one, if the record of the first virtual resource residue ranking in the global ordered list is compared with the first ranking record in the global virtual resource list, the record of the second virtual resource residue ranking in the global ordered list is compared with the second ranking record in the global virtual resource list, if the records are the same, the records in the global virtual resource list are not adjusted, and if the records in the global ordered list are different, the records in the corresponding position in the global virtual resource list are replaced by the records in the global ordered list, so that the update of the global virtual resource list is completed. For example, if the second record of the virtual resource balance ranking in the global ordered list is different from the second record of the ranking in the global virtual resource list, the second record of the ranking in the global virtual resource list is replaced with the second record of the virtual resource balance ranking in the global ordered list.
It is to be understood that, in some other embodiments, when the record of the preset number of the virtual resource balance top ranking in the global ordered list is inconsistent with the record in the global virtual resource list, the record of the preset number of the virtual resource balance top ranking in the updated global ordered list may also be directly replaced with the record in the global virtual resource list.
According to the method for updating the list of the virtual resource provided by the embodiment of the disclosure, the target distributed data table to which the target user identifier belongs can be searched in the plurality of distributed data tables according to the target user identifier in the change request, the virtual resource balance corresponding to the target user identifier is updated in the target distributed data table according to the target user identifier and the corresponding virtual resource change amount, then the record of the preset number before the virtual resource balance ranking is respectively pulled from the plurality of distributed data tables at preset time intervals, and the global virtual resource list is updated based on the record of the preset number before the virtual resource balance ranking in the pulled record, so that the updating of the global virtual resource list can be completed conveniently, the calculation amount during the updating of the list is greatly reduced, and the timely updating of the list is ensured. Meanwhile, after the virtual resource allowance corresponding to the target user identification is updated, the record with the zero virtual resource allowance in the distributed data table can be directly deleted or deleted at regular time, so that the data volume of the distributed data table can be reduced, the accumulation of dirty data is avoided, the data calculation amount is reduced, and the list updating speed of the virtual resources is further improved. In addition, the records are stored in the distributed data tables in a fragmentation mode, and list updating of virtual resources of massive users can be supported.
Fig. 4 is a block diagram illustrating a listing update apparatus 400 for a virtual resource according to an example embodiment. Referring to fig. 4, the apparatus includes a receiving unit 401, a searching unit 402, a first updating unit 403, a pulling unit 404, a second updating unit 405, a deleting unit 406, a judging unit 407, and a third updating unit 408.
The receiving unit 401 is configured to execute a virtual resource change request sent by a receiving user side, where the virtual resource change request carries a target user identifier and a corresponding virtual resource change amount.
It is to be understood that the receiving unit 401 may be configured to perform the above step S21.
The searching unit 402 is configured to perform searching, according to the target user identifier, a target distributed data table to which the target user identifier belongs, from the plurality of distributed data tables.
The distributed data tables are used for storing user identifications and corresponding virtual resource margins in a distributed mode.
It is to be understood that the lookup unit 402 may be configured to perform the above step S22.
A judging unit 407 configured to perform judgment on whether there is a record in the target distributed data table with the user identifier being the same as the target user identifier.
It is understood that the judging unit 407 may be configured to perform the above step S231.
The first updating unit 403 is configured to update the virtual resource remaining amount corresponding to the target user identifier in the target distributed data table according to the target user identifier and the corresponding virtual resource change amount.
Specifically, the first updating unit 403 is configured to perform, when there is a record in the target distributed data table with a user identifier that is the same as the target user identifier, updating the virtual resource remaining amount recorded in the same record according to the virtual resource change amount; and when the target distributed data table does not have a record with the user identification being the same as the target user identification, taking the virtual resource change amount as the virtual resource allowance corresponding to the target user identification, and writing a new record into the target distributed data table according to the target user identification and the corresponding virtual resource allowance.
It is understood that the first updating unit 403 may be configured to perform the above-mentioned steps S232 and S233.
The deleting unit 406 is configured to delete the record with the virtual resource margin of zero after updating the virtual resource margin corresponding to the target user identifier; or deleting the records with zero virtual resource allowance in the plurality of distributed data tables at regular time.
The pulling unit 404 is configured to perform pulling of a record of a preset number of virtual resource headroom ranks from the plurality of distributed data tables, respectively
It is understood that the pulling unit 404 may be configured to perform the step S24 described above.
The third updating unit 408 is configured to perform updating of the records in the global ordered list according to the pulled records.
The second updating unit 405 is configured to perform updating the global virtual resource list based on the pulled record.
Specifically, the second updating unit 405 is configured to update the global virtual resource list based on the record of the preset number before the virtual resource allowance ranking in the updated global ordered list.
It is to be understood that the second updating unit 405 may be configured to perform the above-mentioned step S25.
The list updating apparatus 400 for virtual resources according to the embodiment of the present disclosure can search a target distributed data table to which a target user identifier belongs from a plurality of distributed data tables according to the target user identifier in the change request, update a virtual resource balance corresponding to the target user identifier in the target distributed data table according to the target user identifier and a corresponding virtual resource change amount, then pull a record of a preset number before the virtual resource balance ranking from the plurality of distributed data tables at preset time intervals, and update the global virtual resource list based on the record of the preset number before the virtual resource balance ranking in the pulled record, so that the update of the global virtual resource list can be completed very conveniently, thereby greatly reducing an amount of operations during list update, and ensuring timely update of the list. Meanwhile, after the virtual resource allowance corresponding to the target user identification is updated, the record with the zero virtual resource allowance in the distributed data table can be directly deleted or deleted at regular time, so that the data volume of the distributed data table can be reduced, the accumulation of dirty data is avoided, the data calculation amount is reduced, and the list updating speed of the virtual resources is further improved. In addition, the records can be stored in a plurality of distributed data tables in a slicing mode, and list updating of virtual resources of massive users can be supported.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
FIG. 5 is a block diagram illustrating an electronic device in accordance with an example embodiment. Referring to fig. 5, the electronic device comprises a processing component 51, which further comprises one or more processors, and memory resources, represented by memory 52, for storing instructions, such as application programs, executable by the processing component 51. The application programs stored in memory 52 may include one or more modules that each correspond to a set of instructions. Further, the processing component 51 is configured to execute instructions to perform the above-described listing update method for virtual resources. For example, the list updating method for the virtual resource includes the following steps:
receiving a virtual resource change request sent by a user side, wherein the virtual resource change request carries a target user identifier and a corresponding virtual resource change amount;
searching a target distributed data table to which the target user identification belongs in a plurality of distributed data tables according to the target user identification, wherein the plurality of distributed data tables are used for storing each user identification and corresponding virtual resource allowance in a distributed mode;
updating the virtual resource allowance corresponding to the target user identification in the target distributed data table according to the target user identification and the corresponding virtual resource change amount;
respectively pulling records of a preset number before the virtual resource allowance ranking from the plurality of distributed data tables;
and updating the global virtual resource list based on the pulled record.
The electronic device may also include a power supply component 53 configured to perform power management of the electronic device, a wired or wireless network interface 54 configured to connect the server to a network, and an input/output (I/O) interface 55. The electronic device may operate based on an operating system stored in memory 52, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
The electronic device for virtual resources provided by the embodiment of the disclosure can search a target distributed data table to which a target user identifier belongs from a plurality of distributed data tables according to the target user identifier in a change request, update a virtual resource allowance corresponding to the target user identifier in the target distributed data table according to the target user identifier and a corresponding virtual resource change amount, and then respectively pull a record of a preset number of virtual resource allowances before ranking from the plurality of distributed data tables at preset time intervals and update a global virtual resource list based on the record of the preset number of virtual resource allowances before ranking in the pulled record, so that the update of the global virtual resource list can be completed very conveniently, the calculation amount during list update is greatly reduced, and the timely update of the list is ensured. Meanwhile, after the virtual resource allowance corresponding to the target user identification is updated, the record with the zero virtual resource allowance in the distributed data table can be directly deleted or deleted at regular time, so that the data volume of the distributed data table can be reduced, the accumulation of dirty data is avoided, the data calculation amount is reduced, and the list updating speed of the virtual resources is further improved. In addition, the records can be stored in a plurality of distributed data tables in a fragmentation mode, and list updating of virtual resources of massive users can be supported.
In an exemplary embodiment, a storage medium comprising instructions, such as the memory 52 comprising instructions, executable by the processor of the apparatus 400 to perform the above-described method for list update of virtual resources is also provided. For example, the list updating method for the virtual resource includes the following steps:
receiving a virtual resource change request sent by a user side, wherein the virtual resource change request carries a target user identifier and a corresponding virtual resource change amount;
searching a target distributed data table to which the target user identification belongs in a plurality of distributed data tables according to the target user identification, wherein the plurality of distributed data tables are used for storing each user identification and corresponding virtual resource allowance in a distributed mode;
updating the virtual resource allowance corresponding to the target user identification in the target distributed data table according to the target user identification and the corresponding virtual resource change amount;
respectively pulling records of the number of the virtual resource allowance ranks preset from the distributed data tables;
and updating the global virtual resource list based on the pulled record.
The storage medium for virtual resources provided by the embodiment of the disclosure can search a target distributed data table to which a target user identifier belongs from a plurality of distributed data tables according to the target user identifier in a change request, update a virtual resource allowance corresponding to the target user identifier in the target distributed data table according to the target user identifier and a corresponding virtual resource change amount, and then respectively pull a record of a preset number of virtual resource allowances before ranking from the plurality of distributed data tables at preset time intervals and update a global virtual resource list based on the record of the preset number of virtual resource allowances before ranking in the pulled record, so that the update of the global virtual resource list can be completed very conveniently, the calculation amount during list update is greatly reduced, and the timely update of the list is ensured. Meanwhile, after the virtual resource allowance corresponding to the target user identification is updated, the record with the zero virtual resource allowance in the distributed data table can be directly deleted or deleted at regular time, so that the data volume of the distributed data table can be reduced, the accumulation of dirty data is avoided, the data calculation amount is reduced, and the list updating speed of the virtual resources is further improved. In addition, the records can be stored in a plurality of distributed data tables in a fragmentation mode, and list updating of virtual resources of massive users can be supported.
The embodiment of the disclosure also provides a computer program product, which includes instructions, and when the computer program product is executed by a computer, the instructions cause the computer to execute the list updating method for the virtual resource. For example, the list updating method for the virtual resource includes the following steps:
receiving a virtual resource change request sent by a user side, wherein the virtual resource change request carries a target user identifier and a corresponding virtual resource change amount;
searching a target distributed data table to which the target user identification belongs in a plurality of distributed data tables according to the target user identification, wherein the plurality of distributed data tables are used for storing each user identification and corresponding virtual resource allowance in a distributed mode;
updating the virtual resource allowance corresponding to the target user identification in the target distributed data table according to the target user identification and the corresponding virtual resource change amount;
respectively pulling records of the number of the virtual resource allowance ranks preset from the distributed data tables;
updating the global virtual resource list based on the pulled record.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (9)

1. A list updating method for virtual resources is characterized by comprising the following steps:
receiving a virtual resource change request sent by a user side, wherein the virtual resource change request carries a target user identifier and a corresponding virtual resource change amount;
searching a target distributed data table to which the target user identification belongs in a plurality of distributed data tables according to the target user identification, wherein the plurality of distributed data tables are used for storing each user identification and corresponding virtual resource allowance in a distributed mode;
updating the virtual resource allowance corresponding to the target user identification in the target distributed data table according to the target user identification and the corresponding virtual resource change amount;
respectively pulling records of a preset number before the virtual resource allowance ranking from the plurality of distributed data tables;
updating a global virtual resource list based on the pulled records, wherein the global virtual resource list is generated according to a record of a preset number of virtual resource allowance ranks pulled from the distributed data tables at the last time;
after the virtual resource allowance corresponding to the target user identification is updated, deleting the record with the virtual resource allowance of zero; or
And deleting the records with zero virtual resource allowance in the plurality of distributed data tables at regular time.
2. The method of claim 1, wherein the updating, in the target distributed data table, the virtual resource remaining amount corresponding to the target user id according to the target user id and the corresponding virtual resource change amount comprises:
when a record with the user identification being the same as the target user identification exists in the target distributed data table, updating the virtual resource allowance recorded in the same record according to the virtual resource change amount;
and when no record with the same user identifier as the target user identifier exists in the target distributed data table, taking the virtual resource change amount as the virtual resource allowance corresponding to the target user identifier, and writing a new record in the target distributed data table according to the target user identifier and the corresponding virtual resource allowance.
3. The method according to claim 1, wherein after the pulling the record of the pre-set number of virtual resource headroom ranks from the plurality of distributed data tables, respectively, the method further comprises:
updating the records in the global ordered list according to the pulled records;
the updating of the global virtual resource list based on the pulled record includes:
and comparing the updated record of the preset number before the virtual resource residue balance ranking in the global ordered list with the record in the global virtual resource list, and updating the global virtual resource list according to the record of the preset number before the virtual resource residue balance ranking in the global ordered list when the record of the preset number before the virtual resource residue balance ranking in the global ordered list is inconsistent with the record in the global virtual resource list.
4. The method of claim 1, wherein the pulling records of a preset number of top virtual resource headroom ranks from the plurality of distributed data tables, respectively, comprises:
and respectively pulling records of a preset number before the virtual resource allowance ranking from the plurality of distributed data tables at preset time intervals.
5. A list update apparatus for a virtual resource, comprising:
the system comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is configured to execute a virtual resource change request sent by a receiving user side, and the virtual resource change request carries a target user identifier and a corresponding virtual resource change amount;
the searching unit is configured to search a target distributed data table to which the target user identifier belongs in a plurality of distributed data tables according to the target user identifier, wherein the plurality of distributed data tables are used for storing each user identifier and corresponding virtual resource allowance in a distributed manner;
a first updating unit, configured to update the virtual resource allowance corresponding to the target user identifier in the target distributed data table according to the target user identifier and the corresponding virtual resource change amount;
a pulling unit configured to perform pulling of records of a preset number of virtual resource allowance ranks from the plurality of distributed data tables, respectively;
a second updating unit configured to perform updating of a global virtual resource list based on the pulled records, wherein the global virtual resource list is generated according to a record of a preset number of previous virtual resource allowance ranks pulled from the plurality of distributed data tables at the last time;
a deleting unit configured to delete a record of which the virtual resource margin is zero after updating the virtual resource margin corresponding to the target user identifier; or
And deleting the records with zero virtual resource allowance in the distributed data tables at regular time.
6. The apparatus for updating a list of virtual resources of claim 5, further comprising:
a judging unit configured to perform judgment on whether a record with a user identifier identical to the target user identifier exists in the target distributed data table;
the first updating unit is configured to update the virtual resource allowance recorded in the same record according to the virtual resource change amount when a record with the same user identifier as the target user identifier exists in the target distributed data table; and
and when no record with the same user identifier as the target user identifier exists in the target distributed data table, taking the virtual resource change amount as the virtual resource allowance corresponding to the target user identifier, and writing a new record in the target distributed data table according to the target user identifier and the corresponding virtual resource allowance.
7. The apparatus for updating a list of virtual resources of claim 5, further comprising:
a third updating unit configured to perform updating of the records in the global ordered list according to the pulled records;
the second updating unit is configured to compare the updated record of the preset number before the virtual resource residue balance ranking in the global ordered list with the record in the global virtual resource list, and update the global virtual resource list according to the record of the preset number before the virtual resource residue balance ranking in the global ordered list when the record of the preset number before the virtual resource residue balance ranking in the global ordered list is inconsistent with the record in the global virtual resource list.
8. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the leaderboard update method of the virtual resource of any of claims 1-4.
9. A storage medium having instructions that, when executed by a processor of an electronic device, enable the electronic device to perform a list update method for a virtual resource as recited in any one of claims 1 to 4.
CN202010292389.7A 2020-04-14 2020-04-14 List updating method and device for virtual resources, electronic equipment and storage medium Active CN111464826B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010292389.7A CN111464826B (en) 2020-04-14 2020-04-14 List updating method and device for virtual resources, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010292389.7A CN111464826B (en) 2020-04-14 2020-04-14 List updating method and device for virtual resources, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111464826A CN111464826A (en) 2020-07-28
CN111464826B true CN111464826B (en) 2022-09-09

Family

ID=71680661

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010292389.7A Active CN111464826B (en) 2020-04-14 2020-04-14 List updating method and device for virtual resources, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111464826B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113171618A (en) * 2021-04-16 2021-07-27 网易(杭州)网络有限公司 Game data display method and device, processor and storage medium
CN113157714A (en) * 2021-04-29 2021-07-23 北京达佳互联信息技术有限公司 List data updating method and device, electronic equipment and storage medium
CN113377831B (en) * 2021-05-31 2023-02-21 北京达佳互联信息技术有限公司 Resource data query method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000044169A1 (en) * 1999-01-26 2000-07-27 Pixelworld Network, Inc. System and method for sending live video on the internet
US9436508B1 (en) * 2010-12-20 2016-09-06 Amazon Technologies, Inc. Provisioning virtual resource on a server based on label associated with virtual resource and servers
CN110351572A (en) * 2019-07-10 2019-10-18 广州虎牙科技有限公司 Update method, device, equipment and the storage medium of direct broadcasting room information
CN110377611A (en) * 2019-07-12 2019-10-25 北京三快在线科技有限公司 Integrate the method and device of ranking

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030050831A1 (en) * 1998-12-22 2003-03-13 John Klayh System for distribution and redemption of loyalty points and coupons
WO2005078623A1 (en) * 2004-02-11 2005-08-25 Alio Inc. Distributed system and methodology for delivery of media content
US8275859B2 (en) * 2009-03-31 2012-09-25 International Business Machines Corporation Selective partial updates of web content
CN103299330A (en) * 2010-10-21 2013-09-11 圣脑私营有限责任公司 Method and apparatus for neuropsychological modeling of human experience and purchasing behavior
EP3399446B1 (en) * 2015-08-28 2020-09-23 Swirlds, Inc. Methods and apparatus for distributed database within a network
CN108153758A (en) * 2016-12-02 2018-06-12 阿里巴巴集团控股有限公司 A kind of data accumulation method, apparatus and electronic equipment
US11341467B2 (en) * 2018-05-15 2022-05-24 Comcast Cable Communications, Llc Systems and methods for monitoring content consumption
EP3618348B1 (en) * 2018-08-31 2021-03-10 Siemens Aktiengesellschaft Distributed database system, industry automation system and method for operating a distributed database system
CN110795446A (en) * 2019-10-29 2020-02-14 北京字节跳动网络技术有限公司 List updating method and device, readable medium and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000044169A1 (en) * 1999-01-26 2000-07-27 Pixelworld Network, Inc. System and method for sending live video on the internet
US9436508B1 (en) * 2010-12-20 2016-09-06 Amazon Technologies, Inc. Provisioning virtual resource on a server based on label associated with virtual resource and servers
CN110351572A (en) * 2019-07-10 2019-10-18 广州虎牙科技有限公司 Update method, device, equipment and the storage medium of direct broadcasting room information
CN110377611A (en) * 2019-07-12 2019-10-25 北京三快在线科技有限公司 Integrate the method and device of ranking

Also Published As

Publication number Publication date
CN111464826A (en) 2020-07-28

Similar Documents

Publication Publication Date Title
CN111464826B (en) List updating method and device for virtual resources, electronic equipment and storage medium
CN110659121B (en) Task data acquisition method and device, task configuration method and device and server
US20120158744A1 (en) Ranking and updating of contact information from multiple sources
CN107920103B (en) Information pushing method and system, client and server
CN106911487B (en) Method and device for voice chat
CN106713985B (en) Method and device for recommending network video
CN110427386B (en) Data processing method, device and computer storage medium
CN102769640B (en) The update method of user profile, server and system
US20170046376A1 (en) Method and system for monitoring data quality and dependency
CN112104505B (en) Application recommendation method, device, server and computer readable storage medium
EP3543945A1 (en) Method and device for generating aggregated content, and medium
EP3627352A2 (en) Offline briefcase synchronization
CN109241031B (en) Model generation method, model using method, device, system and storage medium
CN112689170B (en) Content playing method of display terminal, display terminal and readable storage medium
CN111475678B (en) Method, server and terminal for pushing search results
CN112118487B (en) Video playing control method, device, equipment and medium
CN111625690A (en) Object recommendation method, device, equipment and medium
CN113468346B (en) Resource processing method and device, electronic equipment and storage medium
CN113326397A (en) Service data processing method and device
CN113794935A (en) Resource playing method, device, correlation system, server, terminal and storage medium
CN109213955B (en) Data processing method and related equipment
CN110647653A (en) Song recommendation method and device and computer storage medium
CN113395262B (en) Multi-terminal information sharing method and device, computer equipment and storage medium
CN112861041B (en) Media content display method and device, electronic equipment and storage medium
CN113938757B (en) Management method of media resources, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant