A method for counting online live programs with high efficiency and low occupancy

CN115834963BActive Publication Date: 2024-10-11ZHONGSHAN YILIAN INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211503894.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-28
Publication Date
2024-10-11
Estimated Expiration
2042-11-28

AI Technical Summary

Technical Problem

[0003]现有技术中,在用户量庞大,或是使用高峰期的系统中,定时计算和生成最新在线节目列表往往需要花费更多的服务器和数据库资源,甚至有可能影响服务的正常工作,所以设计一套高效率,系统占用率低的生成在线节目列表的方法是十分有必要的

Benefits of technology

[0028] 1. This high-efficiency and low-occupancy method of counting online live programs is reported regularly to the red i s database by the module responsible for streaming media. The complete program list and program groups are also pushed to the red i s database. All operations included in the group are also pushed to the red i s database. They are all composed of the basic operations of Red IS. Multiple instructions use pipeline technology to ensure efficient operation and at the same time access the database as little as possible. The entire process is completed automatically without the participation of operation and maintenance personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115834963B_ABST
    Figure CN115834963B_ABST
Patent Text Reader

Abstract

The invention discloses a method for counting online live programs with high efficiency and low occupancy, and relates to the technical field of streaming media management. The state of live programs is reported to a redis database by a module responsible for streaming media at regular intervals, and the program management module groups a complete program list and programs, and the programs contained in the group are also pushed to the redis database. All operations are combined with basic operations of redis, and multiple instructions use pipeline technology to ensure efficient operation. The method reports to the redis database at regular intervals by a module responsible for streaming media, groups a complete program list and programs, and uses pipeline technology for multiple instructions to ensure efficient operation, while accessing the database as little as possible, and the whole process is completed automatically, without the participation of operation and maintenance personnel, and can efficiently generate program lists in front of a large number of live programs, without obvious impact on services, and provide accurate and high-quality program lists.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of streaming media management, in particular to a method for counting online live programs with high efficiency and low occupancy. Background Art

[0002] In recent years, with the iteration of network equipment, network quality has been further improved, and people can do more things on the Internet. Live broadcast, short video, streaming and other related services are becoming more and more popular and have penetrated into people's lives. Every company that provides streaming-related services will invest a lot of manpower and material resources to develop and maintain a streaming management system. In a large streaming video live broadcast platform, providing users with a high-quality, highly active online program list is an indispensable function.

[0003] In the prior art, in a system with a large number of users or during peak usage, regular calculation and generation of the latest online program list often requires more server and database resources, and may even affect the normal operation of the service. Therefore, it is very necessary to design a method for generating an online program list with high efficiency and low system occupancy. Summary of the invention

[0004] In view of the deficiencies of the prior art, the present invention provides a method for counting online live programs with high efficiency and low occupancy, so as to solve the problems raised in the above background technology.

[0005] To achieve the above object, the present invention provides the following technical solution: a method for counting online live programs with high efficiency and low occupancy, comprising the following specific implementation steps:

[0006] S1. The module for encoding the program stream periodically extracts the parameters and status data of the program during operation, caches them in the local memory, and calculates the data used to measure the program quality based on the parameters and status data;

[0007] S2, summarizing and arranging the parameters and status data extracted in step S1 and the data calculated for measuring program quality to form program status data, and then reporting the program status data to the redis database, using pipeline technology to batch update to the redis database, using each program ID as the KEY value, and using HASHMAP to save the program status data of each item;

[0008] S3, start a timer task in the module responsible for processing the program list, which periodically reads the set of all program IDs and the program status data in step S2 corresponding to the ID, and performs database calculation;

[0009] S4, after sorting all the program status data read in step S3, weighing various parameters, obtaining the result of whether each program is online, and saving the ID of the program determined to be online to the redis database, generating a new temporary set of all online programs;

[0010] S5, performing a symmetric difference between the temporary set of all online program IDs generated in step S3 and the set of all online program IDs generated in the previous task, and judging the result;

[0011] S6, delete the set of all online program IDs generated in the previous task cycle, and name the temporary set of all online program IDs generated in step S3 as the set of all online programs, complete the replacement of the old program list with the new program list, and obtain a redisset set that stores all program IDs determined to be online, and generate a new online program list for each grouped program according to the set of all programs;

[0012] S7, read the IDs of all preset groups in the system through the set of all program groups stored in the redis data, and obtain a list of programs contained in each group after the group ID is obtained. The type of the list is the ZSET structure of the redis database, and the structure is used to make an intersection with the list of all online programs generated in step S6 to obtain the ZSET structure of the online program ID of the current group;

[0013] S8, using the temporary list generated in step S7 and the grouped online program ID list generated in the previous task cycle to make an intersection and judge the result;

[0014] S9, deleting the online list of the group that needs to be updated, renaming the temporary list to the name of the online program set of the group, and updating the version number of the program list of the group;

[0015] S10. Update the program ID lists of all groups and the list version numbers in accordance with steps S7 and S8 in sequence. Thus, one update cycle is completed.

[0016] To further optimize the technical solution, in step S1, the data for measuring program quality include the frame rate and bit rate of the video, and based on the data, it is determined whether there is a problem of video or audio missing and frame loss.

[0017] To further optimize the technical solution, in step S2, each program ID is used as the KEY value, and HASHMAP is used to save the program status data of each item, so as to ensure that when other modules in the system need the status of one or more programs, they can directly use the program ID value to efficiently read the program status information from the redis database.

[0018] To further optimize the technical solution, in step S3, database operations all use basic instructions and set operations provided by the redis database, all generated list sets and temporary sets use SET sets and related operations provided by the redis database, and basic instructions all use pipeline technology to ensure high efficiency based on the above operations.

[0019] To further optimize the technical solution, in step S5, if the result is 0, it means that all online programs have not changed compared with the previous cycle, that is, the online program list has not changed, and there is no need to continue executing, and the task ends here; if the result is not 0, it means that the online program ID list has changed compared with the previous task cycle, and some programs have been judged to be offline or some programs have been restored to online.

[0020] To further optimize the technical solution, in step S8, if the result is empty, it means that the programs in the group are the same as the list generated in the last task cycle and do not need to be updated; if the result is not empty, it means that the program list has changed and needs to be updated.

[0021] To further optimize the technical solution, in step S10, different structures of ZSET and SET can be used to perform set operations during the update process, and the order characteristics before the operation in ZSET can be guaranteed, so that the arrangement order of the programs preset in the group will not be affected before and after the update.

[0022] To further optimize the technical solution, the method also includes a method for updating the program list based on the client, and the continuous updating of the program list is completed through the client.

[0023] To further optimize the technical solution, the method for updating the program list on the client specifically includes the following contents:

[0024] After logging in, the client chooses to obtain the group program list and obtains the list version number of the corresponding group;

[0025] During use, the client periodically obtains the latest version number of the current group and periodically completes the continuous update of the program list.

[0026] To further optimize this technical solution, when the local version number is different from the newly obtained version number during the process of periodically obtaining the latest version number of the current group, it means that the current program list corresponding to the server has changed. At this time, the client can choose to use the interface for obtaining the group program list to re-acquire the program list.

[0027] Compared with the prior art, the present invention provides a method for counting online live programs with high efficiency and low occupancy, which has the following beneficial effects:

[0028] 1. This high-efficiency and low-occupancy method for counting online live programs reports to the redis database at regular intervals through the module responsible for streaming media, groups the complete program list and programs, and pushes the programs contained in the groups to the redis database. All operations are combined with basic redis operations, and multiple instructions use pipeline technology to ensure efficient calculations while accessing the database as little as possible. The entire process is completed automatically without the need for operation and maintenance personnel to participate.

[0029] 2. The high-efficiency and low-occupancy method for counting online live programs can efficiently generate program lists in front of a large number of live programs without obvious impact on services, and provide accurate and high-quality program lists. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 A schematic diagram of the flow of S4 in a method for counting online live programs with high efficiency and low occupancy proposed by the present invention;

[0031] Figure 2 A schematic diagram of the flow of S5 in a method for counting online live programs with high efficiency and low occupancy proposed by the present invention;

[0032] Figure 3 A schematic diagram of the flow of S10 in a method for counting online live programs with high efficiency and low occupancy proposed by the present invention;

[0033] Figure 4 The present invention provides a flowchart of a client updating a program list in a method for counting online live programs with high efficiency and low occupancy. DETAILED DESCRIPTION

[0034] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0035] Example:

[0036] A method for counting online live programs with high efficiency and low occupancy, in which the module responsible for streaming media regularly reports to the redis database, groups the complete program list and programs, and pushes the programs contained in the group to the redis database. All operations are combined with the basic operations of redis, and multiple instructions use pipeline technology to ensure efficient calculations while accessing the database as little as possible. The whole process is completed automatically without the participation of operation and maintenance personnel. The method includes the following specific implementation steps:

[0037] S1. The module for encoding the program stream periodically extracts the parameters and status data of the program during operation, caches them in the local memory, and calculates the data for measuring the program quality based on the parameters and status data. The data for measuring the program quality includes the frame rate and bit rate of the video, and determines whether there is a problem of video or audio missing and frame loss based on the data.

[0038] S2. Summarize and organize the parameters and status data extracted in step S1 and the calculated data for measuring program quality to form program status data, and then report the program status data to the redis database. Use pipeline technology to batch update the data to the redis database, use each program ID as a KEY value, and use HASHMAP to save the program status data of each item. Use each program ID as a KEY value, and use HASHMAP to save the program status data of each item. This is used to ensure that when other modules in the system need one or more program statuses, they can directly use the program ID value to efficiently read the program status information from the redis database.

[0039] S3. Start a timed task in the module responsible for processing the program list. The task periodically reads the set of all program IDs and the program status data in step S2 of the corresponding ID, and performs database operations. The database operations all use the basic instructions and set operations provided by the redis database. All generated list sets and temporary sets use the SET sets and related operations provided by the redis database. The basic instructions all use pipeline technology, and high efficiency is guaranteed based on the above operations.

[0040] S4, such as Figure 1As shown, after sorting out all the program status data read in step S3, weighing various parameters, obtaining the result of whether each program is online, and saving the ID of the program determined to be online to the redis database, generating a new temporary set of all online programs (all:act:ch:new); eliminating those programs that are determined to be not working or abnormal, and only saving the ID values ​​of all online programs, the list data items are large, but the actual memory occupied is very small; using the SET structure of the redis database for storage.

[0041] S5, such as Figure 2 As shown, a symmetric difference is made between the temporary set of all online program IDs generated in step S3 (all:act:ch:new) and the set of all online program IDs generated in the previous task (all:act:ch), and the result is judged. If the result is 0, it means that all online programs have not changed compared with the previous cycle, that is, the online program list has not changed, and there is no need to continue executing, and the task ends here; if the result is not 0, it means that the online program ID list has changed compared with the previous task cycle, and some programs have been judged to be offline or some programs have been restored to online.

[0042] S6. Delete the set of all online program IDs generated in the previous task cycle, and name the temporary set of all online program IDs generated in step S3 as the set of all online programs, complete the replacement of the old program list with the new program list, and obtain a redisset set that saves all program IDs determined to be online. Based on this set of all programs, a new online program list for each group is generated for each grouped program.

[0043] S7. Read the IDs of all preset groups in the system through the set (all:category) of all program groups saved in the redis data. Through the group ID, group and (cate:ch:) obtain a list of programs contained in each group. The type of this list is the ZSET structure of the redis database. This structure is used to intersect with the list of all online programs (all:act:ch) generated in step S6 to obtain the ZSET structure of the online program ID of the current group. It should be noted that the cate:ch: structure has program sorting. After intersecting with the unordered SET structure, the order in the result will maintain the order of the data in cate:ch and save it to a new temporary list (act:cate:ch:tmp:).

[0044] S8. Use the temporary list (act:cate:ch:tmp:) generated in step S7 to intersect with the group online program ID list generated in the previous task cycle, and judge the result. If the result is empty, it means that the programs in the group are the same as the list generated in the previous task cycle and do not need to be updated; if the result is not empty, it means that the program list has changed and needs to be updated.

[0045] S9. Delete the online list (act:cate:ch:) of the group that needs to be updated, rename the temporary list (act:cate:ch:tmp:) to the group's online program set name (act:cate:ch:), and update the group's program list version number (mk:act:cate:).

[0046] S10, such as Figure 3 As shown, the program ID lists and list version numbers of all groups are updated in sequence according to steps S7 and S8. During the updating process, set operations can be performed using different structures of ZSET and SET, and the order characteristics before the operation in ZSET can be guaranteed, so that the arrangement order of the preset programs in the group will not be affected before and after the update. At this point, an update cycle is completed.

[0047] like Figure 4 As shown, the method also includes a method for updating the program list based on the client, and the continuous updating of the program list is completed through the client. The method for updating the program list on the client specifically includes the following contents:

[0048] After logging in, the client chooses to obtain the group program list and obtains the list version number of the corresponding group;

[0049] The client periodically obtains the latest version number of the current group during use. During the process of periodically obtaining the latest version number of the current group, when the local version number is different from the newly obtained version number, it means that the current program list corresponding to the server has changed. At this time, the client can choose to use the interface for obtaining the group program list to re-obtain the program list and periodically complete the continuous update of the program list.

[0050] Based on the high-efficiency and low-occupancy method for counting online live programs, the old solution in the prior art takes about 20 seconds to update once when there are 8,000 programs, and reads and writes the database thousands of times; while this method only takes 2 seconds to update once, and reads and writes the database less than 20 times. It can efficiently generate program lists in front of a large number of live programs without obvious impact on services, and provide accurate and high-quality program lists.

[0051] The beneficial effects of the present invention are:

[0052] 1. This high-efficiency and low-occupancy method for counting online live programs reports to the redis database at regular intervals through the module responsible for streaming media, groups the complete program list and programs, and pushes the programs contained in the groups to the redis database. All operations are combined with basic redis operations, and multiple instructions use pipeline technology to ensure efficient calculations while accessing the database as little as possible. The entire process is completed automatically without the need for operation and maintenance personnel to participate.

[0053] 2. The high-efficiency and low-occupancy method for counting online live programs can efficiently generate program lists in front of a large number of live programs without obvious impact on services, and provide accurate and high-quality program lists.

[0054] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0055] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for counting online live programs with high efficiency and low occupancy. It is characterized in that The specific implementation steps include the following: S1. The module for encoding the program stream periodically extracts the parameters and status data of the program during operation, caches them in the local memory, and calculates the data used to measure the program quality based on the parameters and status data; S2. Summarize and organize the parameters and status data extracted in step S1 and the data calculated for measuring program quality to form program status data, and then report the program status data to the redis database, and use pipeline technology to batch update it to the redis database, with each program ID as the KEY value, and use HASHMAP to save the program status data of each item; S3, start a timer task in the module responsible for processing the program list, which periodically reads the set of all program IDs and the program status data in step S2 corresponding to the ID, and performs database calculation; S4, after sorting all the program status data read in step S3, weighing various parameters, obtaining the result of whether each program is online, and saving the ID of the program determined to be online to the redis database, generating a new temporary set of all online programs; S5, performing a symmetric difference between the temporary set of all online program IDs generated in step S3 and the set of all online program IDs generated in the previous task, and judging the result; S6, delete the set of all online program IDs generated in the previous task cycle, and name the temporary set of all online program IDs generated in step S3 as the set of all online programs, complete the replacement of the old program list with the new program list, and obtain a redisset set that stores all program IDs determined to be online. According to this set of all programs, a new online program list for each grouped program is generated; S7, read the IDs of all preset groups in the system through the set of all program groups saved in the redis data, and obtain a list of programs contained in each group after the group ID is obtained. The type of the list is the ZSET structure of the redis database. The structure is used to make an intersection with the list of all online programs generated in step S6 to obtain the ZSET structure of the online program ID of the current group; S8, using the temporary list generated in step S7 and the grouped online program ID list generated in the previous task cycle to make an intersection and judge the result; S9, deleting the online list of the group that needs to be updated, renaming the temporary list to the name of the online program set of the group, and updating the version number of the program list of the group; S10. Update the program ID lists of all groups and the list version numbers in accordance with steps S7 and S8 in sequence. Thus, one update cycle is completed.

2. According to claim 1, a method for counting online live programs with high efficiency and low occupancy, It is characterized in that In step S1, the data for measuring the program quality include the frame rate and bit rate of the video, and based on the data, it is determined whether there is a problem of video or audio missing and frame loss.

3. According to claim 1, a method for counting online live programs with high efficiency and low occupancy, It is characterized in that In step S2, each program ID is used as the KEY value, and HASHMAP is used to save the program status data of each item, so as to ensure that when other modules in the system need the status of one or more programs, they can directly use the program ID value to efficiently read the status information of the program from the redis database.

4. According to claim 1, a method for counting online live programs with high efficiency and low occupancy, It is characterized in that In step S3, database operations all use the basic instructions and set operations provided by the redis database, all generated list sets and temporary sets use the SET sets and set operations provided by the redis database, and basic instructions all use pipeline technology to ensure high efficiency based on the above operations.

5. According to claim 1, a method for counting online live programs with high efficiency and low occupancy, It is characterized in that In the step S5, if the result is 0, it means that all online programs have not changed compared with the previous cycle, that is, the online program list has not changed, and there is no need to continue executing, and the task ends here; If the result is not 0, it means that the online program ID list has changed compared to the previous task cycle, and some programs have been judged to be offline or some programs have been restored to online.

6. The method for counting online live programs with high efficiency and low occupancy according to claim 1, It is characterized in that In step S8, if the result is empty, it means that the programs in the group are the same as the list generated in the last task cycle and do not need to be updated; if the result is not empty, it means that the program list has changed and needs to be updated.

7. The method for counting online live programs with high efficiency and low occupancy according to claim 1, It is characterized in that In step S10, during the updating process, set operations can be performed using different structures of ZSET and SET, and the order characteristics before the operation in ZSET can be guaranteed, so that the arrangement order of the programs preset in the group will not be affected before and after the update.

8. According to claim 1, a method for counting online live programs with high efficiency and low occupancy, It is characterized in that The method also includes a method for updating the program list based on the client, and the continuous updating of the program list is completed through the client.

9. A method for counting online live programs with high efficiency and low occupancy according to claim 8, It is characterized in that The method for updating the program list on the client specifically includes the following: After logging in, the client chooses to obtain the group program list and obtains the list version number of the corresponding group; During use, the client periodically obtains the latest version number of the current group and periodically completes the continuous update of the program list.

10. A method for counting online live programs with high efficiency and low occupancy according to claim 9, It is characterized in that In the process of periodically obtaining the latest version number of the current group, when the local version number is different from the newly obtained version number, it means that the current program list corresponding to the server has changed. At this time, the client can choose to use the interface for obtaining the group program list to re-acquire the program list.