Transcoding card selection method and device and readable storage medium

By assigning weights and scores to each module of the hardware transcoding card, a candidate list is generated, and the most suitable transcoding card is selected for task allocation. This solves the problem of poor flexibility in traditional hardware transcoding card solutions and improves the transcoding success rate and utilization of the hardware transcoding card.

CN121814967APending Publication Date: 2026-04-07XIAMEN WANGSU CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-24
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Traditional hardware transcoding card solutions rely solely on the utilization rate of the encoding or decoding module as the sole criterion, leading to transcoding failures, task backlog, poor flexibility, and an inability to adapt to complex business needs.

Method used

By assigning weights to each module of the hardware transcoding card and determining the total score of the hardware transcoding card based on the module scores and weights, a candidate list is generated, and the most suitable transcoding card is selected for task allocation.

Benefits of technology

It improved the transcoding success rate, adapted to business needs, reduced operation and maintenance costs, and enhanced the utilization rate of hardware transcoding cards and the smooth execution of transcoding tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121814967A_ABST
    Figure CN121814967A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a transcoding card selection method and device and a readable storage medium, for each hardware transcoding card, an electronic device determines the score of each module of the hardware transcoding card, and determines the total score of the hardware transcoding card according to the score of each module and the weight of each module. Wherein the weights are in positive correlation with the importance degrees of the corresponding modules. And after the total score of each hardware transcoding card is obtained, the electronic equipment determines available hardware transcoding cards according to the total score of each hardware transcoding card so as to obtain a candidate list, and selects a first transcoding card from the candidate list for the transcoding task. By adopting the scheme, the weights are allocated to the modules of the hardware transcoding card according to the importance, the modules are scored, and whether the hardware transcoding card is available or not is determined according to the scores and the weights, so that service requirements are adapted to a great extent, and the purpose of improving the transcoding success rate is achieved. And moreover, which modules of the hardware transcoding card need to work are not concerned, and the condition of the source video is not concerned, so that the universality is very high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of video transcoding technology, and in particular to a method, device and readable storage medium for selecting a transcoding card. Background Technology

[0002] Cloud video transcoding refers to the process of decoding, adjusting parameters, and re-encoding source videos uploaded to the cloud to adapt to different playback scenarios and network environments, and then outputting target videos based on cloud computing resources. The target videos and source videos have different bitrates, resolutions, or formats.

[0003] In traditional solutions, a single server carries multiple hardware transcoding cards to perform video transcoding. After receiving a transcoding task, the server selects a hardware transcoding card with sufficient decoding or encoding module resources from among the multiple hardware transcoding cards and assigns the transcoding task to it.

[0004] The above solution uses the availability of the encoding and decoding modules of the hardware transcoding card as the sole criterion for judgment, which is inflexible and can easily lead to transcoding failure. Summary of the Invention

[0005] This application provides a method, device, and readable storage medium for selecting a transcoding card. By combining the weights of each module of the hardware transcoding card, the usability of the hardware transcoding card is determined, which greatly adapts to business needs and achieves the goal of improving the transcoding success rate.

[0006] In a first aspect, embodiments of this application provide a method for selecting a transcoding card, applied to an electronic device, wherein the electronic device is equipped with multiple hardware transcoding cards, and the method includes: For each of the plurality of hardware transcoding cards, the score of each module of the hardware transcoding card is determined to obtain the score of each module contained in each hardware transcoding card, and the score is used to indicate whether the corresponding module is available. For each of the plurality of hardware transcoding cards, the total score of the hardware transcoding card is determined based on the scores of each module of the hardware transcoding card and the weights of each module of the hardware transcoding card, wherein the weights are positively correlated with the importance of the corresponding modules. A candidate list is determined based on the total score of each of the plurality of hardware transcoding cards, and the candidate list is used to indicate the available hardware transcoding cards among the plurality of hardware transcoding cards; Select the first transcoding card for the transcoding task from the candidate list.

[0007] Secondly, embodiments of this application provide a device for selecting transcoding cards, which is integrated into an electronic device that carries multiple hardware transcoding cards. The device includes: The scoring module is used to determine the score of each module of each of the plurality of hardware transcoding cards, so as to obtain the score of each module contained in each hardware transcoding card, and the score is used to indicate whether the corresponding module is available. A determining module is used to determine the total score of each hardware transcoding card among the plurality of hardware transcoding cards, based on the scores of each module of the hardware transcoding card and the weights of each module of the hardware transcoding card, wherein the weights are positively correlated with the importance of the corresponding modules; A candidate module is used to determine a candidate list based on the total score of each of the plurality of hardware transcoding cards, the candidate list being used to indicate the available hardware transcoding cards among the plurality of hardware transcoding cards; The processing module is used to select the first transcoding card for the transcoding task from the candidate list.

[0008] Thirdly, embodiments of this application provide an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the electronic device implements the method described in the first aspect or various possible implementations of the first aspect.

[0009] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer instructions, which, when executed by a processor, are used to implement the method described in the first aspect or various possible implementations of the first aspect.

[0010] Fifthly, embodiments of this application provide a computer program product comprising a computing program, wherein when the computer program is executed by a processor, it implements the method described in the first aspect or various possible implementations of the first aspect.

[0011] This application provides a method, apparatus, and readable storage medium for selecting transcoding cards. An electronic device is equipped with multiple hardware transcoding cards. For each hardware transcoding card, the electronic device determines the score of each module and, based on the scores and weights of each module, determines the total score of the hardware transcoding card. The weights are positively correlated with the importance of the corresponding modules. After obtaining the total score of each hardware transcoding card, the electronic device determines available hardware transcoding cards based on the total score, thus obtaining a candidate list. Then, the electronic device selects the first transcoding card from the candidate list for the transcoding task. This scheme, by assigning weights to each module of the hardware transcoding card according to importance and scoring each module, determines the usability of the hardware transcoding card based on the scores and weights, greatly adapting to business needs and improving the transcoding success rate. Moreover, it does not focus on which modules of the hardware transcoding card need to work or the source video itself, making it highly versatile. Attached Figure Description

[0012] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This is a schematic diagram of the network architecture of the method for selecting a transcoding card provided in the embodiments of this application; Figure 2 This is a schematic diagram of the hardware transcoding card structure in the method for selecting a hardware transcoding card provided in the embodiments of this application; Figure 3 This is a flowchart of a method for selecting a transcoding card provided in an embodiment of this application; Figure 4 This is another flowchart of the method for selecting a transcoding card provided in the embodiments of this application; Figure 5 A schematic diagram of a device for selecting a transcoding card provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0014] Video transcoding refers to converting a compressed video stream into another video stream to adapt to different network bandwidths, terminal processing capabilities, and user needs. Common video transcoding methods include CPU-based pure software transcoding and hardware transcoding card transcoding. CPU-based pure software transcoding means that all computational logic, from video frame decoding and parameter adjustment to re-encoding, is implemented by software programs, relying entirely on the CPU's general-purpose computing power without utilizing hardware acceleration units. Parameter adjustment includes adjusting resolution and bitrate. While this method can improve video quality, it suffers from high power consumption, low concurrency, and high cost.

[0015] Hardware transcoding cards utilize dedicated hardware modules to complete the core processes of video encoding and decoding. This method offers strong parallel processing capabilities, low latency, and low power consumption. To reduce costs, multiple hardware transcoding cards are installed on a single server. Idle cards are selected based on the principle of minimum utilization, and transcoding tasks are assigned to them. The principle of minimum utilization means minimizing the utilization of either the encoding or decoding module on the hardware transcoding card. In other words, when selecting an idle card, the primary focus is on the utilization rate of either the encoding or decoding module.

[0016] However, traditional hardware transcoding card solutions only consider the utilization rate of the encoding or decoding modules, resulting in poor flexibility. If the transcoding task changes, it can easily lead to transcoding failure. For example, a transcoding task might require artificial intelligence (AI) processing functions, such as image enhancement, intelligent noise reduction, or adding AI subtitles. Traditional hardware transcoding card solutions do not consider the resource status of the AI ​​module. If the encoding and decoding modules of a hardware transcoding card are idle, but the AI ​​module is overloaded, the server will still allocate transcoding tasks to that hardware transcoding card, ultimately causing the transcoding task to fail due to insufficient AI module resources.

[0017] For example, a batch of transcoding tasks may require scaling, adjusting the resolution from 4K to 720P and 1080P. Traditional hardware transcoding card solutions do not consider a scaling module. If the encoding and decoding modules of a hardware transcoding card are idle, but the scaling module is saturated, the server will still allocate transcoding tasks to that hardware transcoding card, ultimately causing the transcoding tasks to fail due to insufficient resources in the scaling module.

[0018] Clearly, traditional hardware transcoding card solutions, which rely solely on the availability of the encoding and decoding modules as the sole criterion for judgment, lack flexibility and are prone to transcoding failures.

[0019] Furthermore, if multiple transcoding tasks occur concurrently, the update speed of the hardware transcoding card's status information is delayed, meaning it cannot keep up with the task allocation speed. This results in a large number of transcoding tasks being concentrated on the same hardware transcoding card with the lowest utilization rate, causing transcoding task backlog. This is because the traditional card selection strategy is to select the encoding or decoding module with the lowest utilization rate. In practice, the utilization rate of the hardware transcoding card's encoding or decoding module is often only accurately obtained and updated after the encoding or decoding module is actually used.

[0020] For example, when multiple transcoding tasks occur concurrently, such as 1000 new users watching a live stream within one minute, these users may be using a variety of devices including mobile phones, tablets, and computers, and their network environments may include 4G, 5G, and Wi-Fi. Each transcoding task requests the hardware transcoding card almost simultaneously. When the first transcoding task is assigned to the least utilized hardware transcoding card 1, the actual load on hardware transcoding card 1 increases. However, this change in state takes time to be perceived. In other words, the state change needs to be collected and fed back before it can be perceived, and collection and feedback take time. During this period, for subsequent transcoding tasks, hardware transcoding card 1 remains the least utilized hardware transcoding card, so the server will continue to assign transcoding tasks to hardware transcoding card 1, leading to a backlog of transcoding tasks.

[0021] Obviously, when the number of instantaneous transcoding tasks is large, the update speed of the hardware transcoding card's status information cannot keep up with the task allocation speed, resulting in a large number of transcoding tasks being concentrated on the same hardware transcoding card with the lowest utilization rate, causing transcoding tasks to pile up.

[0022] Based on this, embodiments of this application provide a method, device, and readable storage medium for selecting transcoding cards. By assigning weights to each module of the hardware transcoding card according to its importance and scoring each module, the usability of the hardware transcoding card is determined based on the scores and weights. This greatly adapts to business needs and achieves the goal of improving the transcoding success rate.

[0023] Figure 1 This is a schematic diagram of the network architecture of the method for selecting a transcoding card provided in an embodiment of this application. Please refer to... Figure 1 The network architecture includes server 11, terminal device 12 and terminal device 13. A network connection is established between server 11 and terminal device 12, and a network connection is established between server 11 and terminal device 13. Server 11 is equipped with multiple hardware transcoding cards.

[0024] Please refer to Figure 1 Server 11 is equipped with a CPU-based pure software algorithm for video transcoding, multiple hardware transcoding cards, etc. After receiving a transcoding task, server 11 uses the CPU-based pure software algorithm and hardware transcoding cards to transcode the source video to complete the transcoding task. Server 11 can be an edge node or central node in a Content Delivery Network (CDN), or a server in the cloud video field.

[0025] In this application, video transcoding refers to the process of decoding, adjusting parameters, and re-encoding a source video to output a target video. The aim is to adjust the bitrate, resolution, and format of the source video to adapt to different playback scenarios and network environments. Playback scenarios include, but are not limited to, mobile phones, televisions, and web pages, while network environments include, but are not limited to, 4G, 5G, and Wi-Fi. For example, a 4K source video can be transcoded into 1080P, 720P, and 480P target videos to meet the playback requirements of mobile phones, tablets, and large-screen devices.

[0026] Terminal device 12 is the user's terminal device. Users request to watch live streams, etc., through terminal device 12. Different users have different types of terminal devices 12 and different network environments. Each terminal device 12 sends a viewing request to server 11, which is equivalent to simultaneously launching multiple transcoding tasks. Server 11 allocates a hardware transcoding card to each transcoding task to complete the transcoding task. If the selected hardware transcoding card has insufficient resources in one or more modules, the CPU's pure software algorithm is directly invoked. In addition to live streaming, users can also watch on-demand content through terminal device 12.

[0027] Terminal device 13 is the terminal device that uploads source video to server 11. For example, after a user shoots a source video, they upload it to server 11. After receiving the source video, server 11 decodes it and adjusts its resolution, bitrate, and other parameters, as well as performing AI processing, to obtain multiple versions of target videos adapted to different scenarios. When terminal device 12 subsequently requests a video, for example, when a user requests on-demand video through terminal 12, server 11 selects the appropriate version of the video based on the type of terminal device 12, network environment, etc., and pushes it to terminal device 12.

[0028] It is understandable that terminal device 12 and terminal device 13 can be the same device or different devices.

[0029] In this embodiment, server 12 is equipped with multiple hardware transcoding cards. Hardware transcoding cards are also known as video transcoding cards, transcoding cards, etc. The multiple hardware transcoding cards can be identical or of different types.

[0030] Figure 2 This is a schematic diagram of the hardware transcoding card structure in the method for selecting a hardware transcoding card provided in this application embodiment. Please refer to... Figure 2 In this embodiment, the hardware transcoding card includes a decoding module 21 and an encoding module 22. Optionally, the hardware transcoding card may also include a scaling module 23 and an AI module 24, as shown in the dashed box. The decoding module 21 is mainly used to decode the source video to restore the uncompressed original video frames and audio data. The source video format includes, but is not limited to, Moving Picture Experts Group-4 (MP4) format and Matroska Video File (MKV) format. Uncompressed original video frames include, for example, Luminance-Chrominance Video Format (YUV), etc., and this embodiment is not limited to these formats.

[0031] The scaling module 23 is used to adjust the image size, resolution, etc. of the original video frames. For example, scaling 4K resolution down to 1080P.

[0032] AI module 24 is used to optimize the video frames output by scaling module 23, such as image quality enhancement, noise reduction, adding AI subtitles, and deblurring.

[0033] The encoding module 22 is used to re-compress and encode the optimized video frames and audio data output by the AI ​​module 24, and package and output the target video according to the target bitrate, container format, etc.

[0034] Simply put, video transcoding is a series of processes: decoding the source video → adjusting its size → optimizing its quality → recompressing and repackaging.

[0035] It should be noted that scaling module 23 and AI module 24 can be flexibly skipped. For example, if the transcoding task indicates that the resolution of the target video is equal to the resolution of the source video, i.e., no scaling is needed, then the weight of scaling module 23 can be set to 0. In this case, the transcoding process is: decoding → AI → encoding.

[0036] For example, if the transcoding task indicates that scaling and image quality optimization are not required, then the transcoding process is: decoding → encoding.

[0037] In this application, the performance limits of each module of a hardware transcoding card are different, i.e., their maximum carrying capacity is different. The lower the performance limit, the more likely it is to become a bottleneck, the more important it is, and the higher its weight should be. For example, the decoding module 21 of the hardware transcoding card can handle a maximum of 8 transcoding tasks at the same time, the encoding module 22 can handle a maximum of 10 transcoding tasks at the same time, the scaling module 23 can handle a maximum of 20 transcoding tasks at the same time, and the AI ​​module can handle a maximum of 15 transcoding tasks at the same time. Among them, the decoding module 21 and the encoding module 22 are more likely to become bottlenecks.

[0038] In this application, the performance limits of corresponding modules on different hardware transcoding cards can be the same or different. For example, hardware transcoding card 1 and hardware transcoding card 2 are two completely identical hardware transcoding cards. Furthermore, the performance limits of the decoding module 21, encoding module 22, scaling module 23, and AI module 24 of hardware transcoding card 1 are 10, 8, 20, and 15 respectively; while hardware transcoding card 3 does not have an AI module 24, and the performance limits of its decoding module 21, encoding module 22, and scaling module 23 are 10, 20, and 20 respectively. Among these, the decoding module 21 is more likely to become a bottleneck.

[0039] In this embodiment, weights are pre-assigned to each module of a hardware transcoding card based on requirements or the performance of the hardware transcoding card. The higher the weight, the more important the module. The weights of each module can be different for different hardware transcoding cards. Continuing with the example above, the weights of the encoding module 22, decoding module 21, scaling module 23, and AI module 24 of hardware transcoding card 1 are 5, 3, 1, and 1, respectively, represented by [5, 3, 1, 1]; the weights of the encoding module 22, decoding module 21, and scaling module 23 of hardware transcoding card 3 are represented as [3, 6, 1].

[0040] As described above, this application allows for flexible setting of the weights of each module on a hardware transcoding card. The weights amplify the impact of critical modules. A higher weight indicates a module is more likely to become a bottleneck, thus having a greater impact on the transcoding task. When selecting an idle card, priority is given to ensuring that the module is idle to prevent insufficient resources from slowing down the overall transcoding efficiency.

[0041] Optionally, server 11 displays a configuration interface showing the weights of each module in each of the plurality of hardware transcoding cards. Then, in response to operations on the configuration interface, server 11 modifies the weights of the selected modules.

[0042] For example, server 11 is equipped with multiple hardware transcoding cards, and the weights of each module on each hardware transcoding card are initial weights. When weights need to be adjusted, the user consults the configuration interface. For instance, server 11 has a display screen, through which the user can access the configuration interface, which displays the status information of each module on the hardware transcoding cards, such as the remaining load, remaining memory, number of currently running tasks, and maximum number of supported tasks for the encoding module. Similarly, the configuration interface also displays the status information of the decoding module, scaling module, and AI module. For each hardware transcoding card, the user configures the weights based on the status information of each module. For example, the status information of the encoding module of a hardware transcoding card might be: remaining load 20%, remaining memory 10%, current number of tasks 8, and maximum number of supported tasks 10. This status information indicates that the encoding module is relatively busy, so a lower weight is configured for the encoding module to prevent more transcoding tasks from being assigned to this hardware transcoding card.

[0043] For example, server 11 establishes a network connection with a management terminal, and the user accesses the configuration interface of the remote server 11 through the management terminal. This configuration interface displays multiple hardware transcoding cards. The user selects the module of the hardware transcoding card whose weight needs to be modified and changes the weight of that module. For instance, the initial weights of the encoding module, decoding module, scaling module, and AI module of a hardware transcoding card are all 2.5. Since a batch of transcoding tasks does not require scaling, the user adjusts the weights of each module from [2.5, 2.5, 2.5, 2.5] to [6, 3, 0, 1].

[0044] For example, the current weights of each module in a hardware transcoding card are [6,3,0,1]. The transcoding task requires scaling but does not require AI processing, so the user adjusts the weights of each module from [6,3,0,1] to [5,3,2,0].

[0045] This approach allows users to adjust the weights of each module on each hardware transcoding card through an open configuration interface. Without modifying the underlying code, the weights of each module can be aligned with dynamic business needs, reducing maintenance costs while improving the utilization rate of the hardware transcoding cards.

[0046] It should be understood that, Figure 1 The number of servers 11, terminal devices 12, and terminal devices 13 shown is merely illustrative. In actual implementation, any number of servers 11, terminal devices 12, and terminal devices 13 can be deployed according to actual needs.

[0047] Below, based on Figure 1 The architecture shown and Figure 2 The structure of the hardware transcoding card shown will be explained in detail with reference to the method for selecting the transcoding card described in this application embodiment. For example, please refer to... Figure 3 , Figure 3 This is a flowchart of a method for selecting a transcoding card provided in an embodiment of this application. This embodiment uses an electronic device, such as the server 11 described above. This embodiment includes: 301. For each of the plurality of hardware transcoding cards, determine the score of each module of the hardware transcoding card to obtain the score of each module contained in each hardware transcoding card, wherein the score is used to indicate whether the corresponding module is available.

[0048] In this application, the electronic device actively or passively determines the score of each module of each hardware transcoding card. For example, the electronic device determines the score of each module of each hardware transcoding card each time it receives a transcoding task. Alternatively, the electronic device periodically determines the score of each module of each hardware transcoding card. Yet another example is that the electronic device determines the score of each module of a hardware transcoding card each time it detects the status information of that hardware transcoding card.

[0049] For any module of each hardware transcoding card, the electronic device determines whether the module is available. If the module is available, its score is determined as a first score; if the module is unavailable, its score is determined as a second score. The first score may be, for example, 1, and the second score may be, for example, 0. This embodiment of the application is not limited to this. For example, if the electronic device determines that the decoding module of the hardware transcoding card is available, the encoding module is unavailable, the scaling module is available, and the AI ​​module is available, then the scores for these four modules are 1, 0, 1, and 1, respectively.

[0050] 302. For each of the plurality of hardware transcoding cards, the total score of the hardware transcoding card is determined based on the scores of each module of the hardware transcoding card and the weights of each module of the hardware transcoding card, wherein the weights are positively correlated with the importance of the corresponding modules.

[0051] After obtaining the scores of each module of a hardware transcoding card, the electronic device determines the overall score of the hardware transcoding card based on the scores and weights of each module. For example, if the scores of the encoding module, decoding module, scaling module, and AI module of a hardware transcoding card are 1, 0, 1, and 1 respectively, and assuming the weights of these four modules are [5, 3, 1, 1], then the score of the hardware transcoding card is: 5×1 + 0×3 + 1×1 + 1×1 = 7 points.

[0052] For example, if the encoding module, decoding module, scaling module, and AI module of a hardware transcoding card have scores of 1, 0, 1, and 1 respectively, and assuming the weights of these four modules are [4, 3, 1, 2], then the score of the hardware transcoding card is: 4×1 + 0×3 + 1×1 + 2×1 = 8 points.

[0053] 303. Based on the total score of each of the plurality of hardware transcoding cards, a candidate list is determined, wherein the candidate list is used to indicate the available hardware transcoding cards among the plurality of hardware transcoding cards.

[0054] After determining the score of each hardware transcoding card, the electronic device selects usable hardware transcoding cards from multiple hardware transcoding cards to obtain a candidate list. For example, the electronic device sorts the hardware transcoding cards according to their total score from high to low to obtain a hardware transcoding card queue, and selects the top 10 hardware transcoding cards in the queue as usable hardware transcoding cards.

[0055] For example, for each hardware transcoding card, the electronic device compares the total score of the hardware transcoding card with the preset score. If the total score is greater than or equal to the preset score, the hardware transcoding card is considered a usable hardware transcoding card; if the total score is less than the preset score, the hardware transcoding card is considered an unusable hardware transcoding card.

[0056] In this embodiment, when the electronic device generates the candidate list, it does not consider which modules of the hardware transcoding card need to work, nor does it consider the source video itself, thus possessing strong versatility. The source video itself includes its frame rate, bitrate, etc.

[0057] 304. Select the first transcoding card for the transcoding task from the candidate list.

[0058] For each transcoding task, the electronic device selects a first transcoding card from the candidate list. The first transcoding card can be any hardware transcoding card in the candidate list, or the first transcoding card can be a hardware transcoding card selected by the electronic device from the candidate list according to certain rules.

[0059] When multiple transcoding tasks occur concurrently, the electronic device generates a candidate list for each transcoding task and selects the first transcoding card from the candidate list for each transcoding task. Alternatively, the electronic device periodically generates a candidate list, which is valid for a duration of, for example, 1 second, 5 seconds, 15 seconds, etc., and the multiple concurrent transcoding tasks share the same candidate list.

[0060] The method for rotating transcoding cards provided in this application embodiment involves an electronic device equipped with multiple hardware transcoding cards. For each hardware transcoding card, the electronic device determines the score of each module of the hardware transcoding card and determines the total score of the hardware transcoding card based on the scores and weights of each module. The weights are positively correlated with the importance of the corresponding modules. After obtaining the total score of each hardware transcoding card, the electronic device determines the available hardware transcoding cards based on the total score, thus obtaining a candidate list. Then, the electronic device selects the first transcoding card from the candidate list for the transcoding task. This scheme, by assigning weights to each module of the hardware transcoding card according to its importance and scoring each module, determines the usability of the hardware transcoding card based on the scores and weights, greatly adapting to business needs and achieving the goal of improving transcoding success rate. Moreover, it does not focus on which modules of the hardware transcoding card need to work or the source video itself, making it highly versatile.

[0061] In the above embodiments, after the electronic device determines the candidate list, it can flexibly select the first transcoding card from the candidate list. In one approach, the electronic device sorts the hardware transcoding cards in the candidate list according to the order of remaining resources from high to low, and selects the hardware transcoding card with the highest remaining resources as the first transcoding card. Remaining resources include, but are not limited to, remaining load, remaining number of tasks, and remaining memory.

[0062] In another approach, the electronic device sorts the hardware transcoding cards in the candidate list according to the maximum number of concurrent channels supported by the encoding module, and selects the hardware transcoding card corresponding to the encoding module that supports the maximum number of concurrent channels as the first transcoding card.

[0063] In another approach, the electronic device determines the process identifier (PID) of the process corresponding to the transcoding task and the system timestamp at which the electronic device receives the transcoding task. Then, the electronic device generates a random seed based on the process identifier and the system timestamp, and selects the first transcoding card for the transcoding task from the candidate list based on the random seed.

[0064] In this embodiment, when the server processes transcoding tasks, each transcoding task is typically executed by an independent process, which is assigned a unique process ID by the server's system. The system timestamp is dynamically changing; that is, transcoding tasks received at different times correspond to different system timestamps. The system timestamp is accurate to milliseconds or even microseconds to ensure that different transcoding tasks at different times correspond to different random seeds. In concurrent scenarios, even if the system timestamps of all transcoding tasks are the same, the difference in process IDs ensures that the random seeds are different. Therefore, the combination of process ID and system timestamp can generate an almost unique random seed.

[0065] After generating a random seed, the electronic device generates a random number based on the seed and selects the first hardware transcoding card based on the random number. For example, if the candidate list includes hardware transcoding card 1, hardware transcoding card 2, and hardware transcoding card 3, and the random seed for transcoding task A is 12345, the electronic device generates a random number 1 based on the seed, therefore the first transcoding card is hardware transcoding card 1. Similarly, if the random seed for transcoding task B is 67893, the electronic device generates a random number 3 based on the seed, therefore the first transcoding card is hardware transcoding card 3. And if the random seed for transcoding task C is 67894, the electronic device generates a random number 8 based on the seed. With a total of 3 hardware transcoding cards, the electronic device performs a modulo operation on the random number 8 and the number of cards 3, resulting in 2, therefore the first transcoding card is hardware transcoding card 2.

[0066] In this scheme, the electronic device generates a unique random seed based on the transcoding task's process number and system timestamp. The first transcoding card is selected from the candidate list based on the different random seeds. The transcoding task is distributed to different idle cards through randomness, avoiding the accumulation of transcoding tasks and achieving load balancing among the hardware transcoding cards in the candidate list, thus avoiding resource waste or local overload.

[0067] Optionally, in the above embodiments, during the process of determining the candidate list based on the total score of each of the plurality of hardware transcoding cards, the electronic device determines a threshold value corresponding to each hardware transcoding card. The threshold value is less than or equal to the sum of the weights of each module of the hardware transcoding card. Then, the electronic device determines the candidate list based on the threshold value corresponding to the hardware transcoding card and the total score of the hardware transcoding cards.

[0068] In this embodiment, the threshold values ​​of different hardware transcoding cards can be the same or different. For example, although the total weight of each module of hardware transcoding card 1 and hardware transcoding card 2 is 10, the threshold value of hardware transcoding card 1 is 8, and the threshold value of hardware transcoding card 2 is 7. If the total score of a hardware transcoding card is greater than or equal to the threshold value, then the hardware transcoding card is usable; if the total score of a hardware transcoding card is less than the threshold value, then the hardware transcoding card is unusable and does not need to appear in the candidate list.

[0069] For example, the weights of the encoding, decoding, scaling, and AI modules of a hardware transcoding card are [5, 3, 1, 1], with a sum of weights of 10 and a threshold of 8. This combination of weights and thresholds means that the total score of the hardware transcoding card can only exceed the threshold and be considered idle when both the encoding and decoding modules are simultaneously idle. If the scores of each module are 0, 1, 1, and 1, meaning the encoding module has insufficient resources while the other modules have sufficient resources, the total score is: 0×5 + 3×1 + 1×1 + 1×1 = 5 points, and the hardware transcoding card is unusable.

[0070] If the scores of each module are 1, 0, 1, and 1, that is, when the decoding module has insufficient resources and the other modules have sufficient resources, the total score is: 1×5 + 3×0 + 1×1 + 1×1 = 7 points, and the hardware transcoding card is unusable.

[0071] If both the decoding and encoding modules have sufficient resources, regardless of whether the scaling and AI modules have sufficient resources, the total score will be at least 1×5 + 3×1 = 8 points, and the hardware transcoding card will be usable.

[0072] For example, the weights of each module in a hardware transcoding card are [5, 2, 2, 1], with a total weight of 10 and a threshold of 9. This combination of weights and thresholds means that the total score of the hardware transcoding card can only exceed the threshold and be considered idle when the encoding, decoding, and scaling modules are all idle simultaneously. If the scores of each module are 0, 1, 1, and 1, meaning the encoding module has insufficient resources while the other modules have sufficient resources, the total score is: 0×5 + 3×1 + 1×1 + 1×1 = 5 points, and the hardware transcoding card is unusable.

[0073] If the scores of each module are 1, 1, 1, and 0, that is, when the AI ​​module has insufficient resources and the other modules have sufficient resources, the total score is: 1×5 + 3×1 + 1×1 + 0×1 = 9 points, and the hardware transcoding card is usable.

[0074] This approach selects available hardware transcoding cards based on weights and thresholds, ensuring sufficient resources for each hardware transcoding card in the candidate list. This, in turn, ensures smooth execution of transcoding tasks and improves the success rate of transcoding tasks.

[0075] Optionally, in the above embodiments, after the electronic device selects a first transcoding card from the candidate list for the transcoding task, it further determines whether a first module exists among the modules included in the first transcoding card, where the first module is a module in the first transcoding card that cannot meet the resource requirements of the transcoding task. That is, the electronic device determines whether each module of the first transcoding card meets the resource requirements of the transcoding task. When the first module exists among the modules included in the first transcoding card and the transcoding task reaches the stage corresponding to the first module, a software algorithm is used to implement the function of the first module; when the first module does not exist among the modules included in the first transcoding card, the transcoding task is completed using the first transcoding card.

[0076] In this embodiment, when the electronic device generates the candidate list, it does not consider which modules of the hardware transcoding card need to work. That is, when the threshold value equals the sum of the weights of each module, all modules of each hardware transcoding card in the candidate list have sufficient resources and are available. However, when the threshold value is less than the sum of the weights, one or more modules of the hardware transcoding card may be unavailable. This is because a hardware transcoding card's total score being greater than or equal to the threshold value does not guarantee that all modules required for the transcoding task are idle.

[0077] For example, a hardware transcoding card has modules with weights of [5, 3, 1, 1] and a threshold of 8 points. Assuming the individual module scores are 1, 1, 0, and 1, the total score is: 1×5 + 3×1 + 0×1 + 1×1 = 9 points. Since the total score exceeds the threshold, the hardware transcoding card is deemed usable, and the server uses it as the first transcoding card for transcoding task a. However, transcoding task a requires scaling the resolution from 1080P to 720P, which necessitates a scaling module. When the server executes transcoding task a using the first transcoding card, it checks each module and finds insufficient resources in the scaling module. Therefore, when transcoding task a reaches the scaling stage, the server calls a software algorithm for scaling. Similarly, if the weights of the encoding, decoding, or AI modules of a hardware transcoding card are 0, but the total score of the hardware transcoding card exceeds the threshold, it is deemed usable. When the hardware transcoding card is used as the first transcoding card for transcoding task b, but the execution of transcoding task b depends on the encoding module, decoding module or AI module, when the server uses the first transcoding card to execute transcoding task b, it calls the corresponding software algorithm when it reaches the encoding stage, decoding stage or AI processing stage.

[0078] For example, a hardware transcoding card has modules with weights of [5, 3, 1, 1] and a threshold of 8 points. Assuming the scores for each module are 1, 1, 1, and 0, the total score is: 1×5 + 3×1 + 1×1 + 1×0 = 9 points. Since the total score exceeds the threshold, the hardware transcoding card is deemed usable, and the server uses it as the first transcoding card for transcoding task b. However, transcoding task b requires AI noise reduction processing of the video, meaning it relies on the AI ​​module. When the server executes transcoding task b using the first transcoding card, it checks each module and finds that the AI ​​module resources are insufficient. Therefore, when transcoding task b reaches the AI ​​processing stage, the server calls a software algorithm to perform the AI ​​processing.

[0079] With this approach, electronic devices do not need to set the threshold value to the maximum. Instead, they rely primarily on hardware transcoding cards for transcoding. When the resources of a certain module of the hardware transcoding card are insufficient, software algorithms are invoked to ensure that the transcoding task is not interrupted as much as possible. This maximizes the utilization rate of the hardware transcoding card and eliminates the need for frequent adjustment of the threshold value, thereby reducing maintenance costs to some extent.

[0080] The following is a detailed explanation of how the electronic device determines the scores of each module in the above embodiments.

[0081] Optionally, for each hardware transcoding card, the electronic device determines whether a second module exists among the four modules of the hardware transcoding card, i.e., whether a module with insufficient resources exists. The second module has at least one of the following characteristics: load exceeds a first threshold, the number of tasks exceeds a second threshold, and remaining memory is less than a third threshold. Here, load represents the resource utilization of the module, usually expressed as a percentage, to reflect the module's busy level. For encoding or decoding modules, load mainly refers to computing power utilization; for scaling modules, load refers to bandwidth utilization generated by pixel processing; for AI modules, load mainly refers to computing power utilization. The number of tasks refers to the number of transcoding tasks the module is currently processing.

[0082] Assuming the first, second, and third thresholds of the encoding module are 90%, 10%, and 10%, respectively, if the load of the encoding module exceeds the first threshold, it indicates that the encoding module's resources are over-utilized; if the number of tasks in the encoding module exceeds the second threshold, it indicates that the encoding module is processing too many transcoding tasks simultaneously; if the remaining memory of the encoding module is less than the third threshold, it indicates that the encoding module's cache or data storage space is insufficient. Therefore, if a module has at least one of the above characteristics, the electronic device determines that the module is the second module, and designates the remaining modules in the hardware transcoding card (excluding the second module) as the third module, and scores the second and third modules. The score of the second module is the first score, and the score of the third module is the second score. The first score can be 0, the second score can be 1, etc., and this embodiment of the application is not limited. Obviously, the second module is an unusable module with insufficient resources, and the third module is a usable module with sufficient resources.

[0083] Using this approach, the electronic device scores the module based on its load, number of tasks, and remaining memory, resulting in high accuracy and speed.

[0084] Optionally, in the above embodiments, after the electronic device determines the candidate list based on the total score of each of the plurality of hardware transcoding cards, it also updates the candidate list.

[0085] In one approach, after receiving a new transcoding task, the electronic device re-scores each module of each hardware transcoding card and calculates the total score of the hardware transcoding cards. Then, based on the total score of each hardware transcoding card and the threshold value, a new candidate list is generated.

[0086] In another approach, the electronic device periodically updates the candidate list. For example, every 10 milliseconds (ms), the electronic device updates the score of each module and the total score of each hardware transcoding card, and then regenerates the candidate list based on the total score of each hardware transcoding card and the threshold value, etc.

[0087] In another embodiment, when a second transcoding card exists among the plurality of hardware transcoding cards, the electronic device updates the total score of the second transcoding card and updates the candidate list based on the total score of the second transcoding card. The second transcoding card is the hardware transcoding card among the plurality of hardware transcoding cards whose status information has been updated, including load, number of tasks, and / or remaining memory.

[0088] In this method, an update to the candidate list is triggered when the status of the hardware transcoding card is updated. The status of the hardware transcoding card includes, but is not limited to, load, number of tasks, and remaining memory. For example, an update to the candidate list is triggered when a hardware transcoding card completes a transcoding task and releases resources. Similarly, an update is triggered when a hardware transcoding card is assigned a new transcoding task. If a hardware transcoding card's total score is higher than a threshold after a status update, the hardware transcoding card is added to the candidate list; if the total score is lower than the threshold, the hardware transcoding card is removed from the candidate list.

[0089] With this approach, when the status information of the hardware transcoding card, such as its load, number of tasks, or remaining memory, is updated, the electronic device updates the candidate list to ensure that the candidate list always reflects the actual available hardware transcoding cards, thereby improving the success rate of transcoding tasks.

[0090] The method for selecting a hardware transcoding card described in this application can be used in both low-concurrency and high-concurrency scenarios. When multiple transcoding tasks occur concurrently, the electronic device generates a candidate list for each transcoding task, or multiple transcoding tasks share the same candidate list. Since the candidate list presents all hardware transcoding cards that meet the threshold values, when selecting the first transcoding card, the electronic device randomly or based on load balancing selects the first transcoding card from the candidate list, which can reduce the risk of single-card overload. In concurrent scenarios, prioritizing the allocation of hardware transcoding cards with sufficient core module resources to transcoding tasks can avoid transcoding failures due to insufficient critical resources and ensure a high transcoding success rate.

[0091] Moreover, in concurrent scenarios, by combining the total score and threshold value to select available cards, when multiple transcoding tasks share the same candidate list, there is no need to perform complex judgments on each transcoding task, thus achieving the goal of quickly selecting the hardware transcoding card.

[0092] With this approach, when multiple transcoding tasks are concurrently running, the electronic device quickly filters out available hardware transcoding cards to obtain a candidate list, and selects a hardware transcoding card for each transcoding task from the candidate list, thus avoiding the accumulation of transcoding tasks on the same hardware transcoding card.

[0093] Figure 4 This is another flowchart of the method for selecting a transcoding card provided in this application embodiment. This embodiment includes: 401. For each hardware transcoding card, assign weights to each module of the hardware transcoding card and set the threshold value for the available hardware transcoding cards.

[0094] Users assign weights to each module based on their needs. For example, if the source video and the target video have the same resolution, meaning no scaling is needed, the scaling module's weight is set to 0.

[0095] For example, if the encoding, decoding, and scaling modules are all bottlenecks, then these three modules should be assigned high weights, such as [5, 2, 2, 1], and the threshold should be set to 9. In this way, the hardware transcoding card will only appear in the candidate list if its encoding, decoding, and scaling modules are all idle.

[0096] For example, if both the encoding and decoding modules are bottlenecks, and the encoding module requires more computing power than the decoding module, then the encoding module is given a higher weight, followed by the decoding module. The weights for the encoding, decoding, scaling, and AI modules are set as [5, 3, 1, 1], with a threshold value of 8. This ensures that the hardware transcoding card will only appear in the candidate list if both its encoding and decoding modules are idle.

[0097] 402. Determine whether the resources of each module are sufficient, and thus determine the score of each module.

[0098] For example, if a module has insufficient resources, it is determined to be an unavailable second module, and its score is the first score; if a module has sufficient resources, it is determined to be an available third module, and its score is the second score.

[0099] 403. For each hardware transcoding card, the total score of the hardware transcoding card is determined based on the scores and weights of each module.

[0100] 404. Generate a candidate list based on the threshold value and the total score of each hardware transcoding card.

[0101] 405. Select the first transcoding card for the transcoding task from the candidate list.

[0102] 406. Before executing the transcoding task, verify the availability of each module of the first transcoding card. If an unavailable first module exists, switch to a software algorithm when executing the stage corresponding to that first module.

[0103] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.

[0104] Figure 5 This is a schematic diagram of a transcoding card selection device provided in an embodiment of this application. The transcoding card selection device 500 is integrated on an electronic device, which carries multiple hardware transcoding cards. The transcoding card selection device 500 includes: a scoring module 51, a determination module 52, a candidate module 53, and a processing module 54.

[0105] The scoring module 51 is used to determine the score of each module of each of the plurality of hardware transcoding cards, so as to obtain the score of each module contained in each hardware transcoding card, and the score is used to indicate whether the corresponding module is available. The determining module 52 is used to determine the total score of each hardware transcoding card among the plurality of hardware transcoding cards, based on the scores of each module of the hardware transcoding card and the weights of each module of the hardware transcoding card, wherein the weights are positively correlated with the importance of the corresponding modules. The candidate module 53 is used to determine a candidate list based on the total score of each of the plurality of hardware transcoding cards, the candidate list being used to indicate the available hardware transcoding cards among the plurality of hardware transcoding cards; Processing module 54 is used to select a first transcoding card for the transcoding task from the candidate list.

[0106] In one feasible implementation, the processing module 54 is used to determine the process ID of the process corresponding to the transcoding task and the system timestamp for receiving the transcoding task; generate a random seed based on the process ID and the system timestamp; and select the first transcoding card for the transcoding task from the candidate list based on the random seed.

[0107] In one feasible implementation, after the processing module 54 selects a first transcoding card for the transcoding task from the candidate list, it is further configured to determine whether a first module exists among the modules included in the first transcoding card, wherein the first module is a module in the first transcoding card that cannot meet the resource requirements of the transcoding task; when the first module exists among the modules included in the first transcoding card and the transcoding task is executed to the stage corresponding to the first module, the function of the first module is implemented using a software algorithm.

[0108] In one feasible implementation, the candidate module 53 is used to determine a threshold value corresponding to each of the plurality of hardware transcoding cards, wherein the threshold value is less than or equal to the sum of the weights of each module of the hardware transcoding card; and to determine the candidate list for each of the plurality of hardware transcoding cards based on the threshold value corresponding to the hardware transcoding card and the total score of the hardware transcoding card.

[0109] In one feasible implementation, the scoring module 51 is used to determine, for each of the plurality of hardware transcoding cards, whether there is a second module among the modules included in the hardware transcoding card. The second module is a module in the hardware transcoding card whose load exceeds a first threshold, whose number of tasks exceeds a second threshold, and / or whose remaining memory is less than a third threshold. When the second module exists among the modules included in the hardware transcoding card, the score of the second module is determined as a first score, and the score of the third module is determined as a second score. The third module is any other module in the hardware transcoding card besides the second module. The first score is used to indicate that the second module is unavailable, and the second score is used to indicate that the third module is available.

[0110] In one feasible implementation, before the determining module 52 determines the total score of the hardware transcoding card based on the scores and weights of each module of the hardware transcoding card, the processing module 54 is further configured to display a configuration interface, on which the weights of each module of each of the plurality of hardware transcoding cards are displayed; and in response to the operation of the configuration interface, the weights of the selected modules are modified.

[0111] In one feasible implementation, after the candidate module 53 determines the candidate list based on the total score of each of the plurality of hardware transcoding cards, the processing module 54 is further configured to update the total score of the second transcoding card when a second transcoding card exists among the plurality of hardware transcoding cards. The second transcoding card is a hardware transcoding card among the plurality of hardware transcoding cards whose status information has been updated, including load, number of tasks, and / or remaining memory; and update the candidate list based on the total score of the second transcoding card.

[0112] In one feasible implementation, the transcoding task is any one of the high-concurrency transcoding tasks.

[0113] The operation interception device provided in this application embodiment can perform the actions of the electronic devices in the above embodiments. Its implementation principle and technical effect are similar, and will not be described again here.

[0114] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 6 As shown, the electronic device 600 includes: Processor 61 and memory 62; The memory 62 stores computer instructions; The processor 61 executes the computer instructions stored in the memory 62, causing the processor 61 to perform the method of selecting a transcoding card as implemented in the above-described electronic device.

[0115] The specific implementation process of processor 61 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0116] Optionally, the electronic device 600 also includes a communication component 63. The processor 61, memory 62, and communication component 63 can be connected via a bus 64.

[0117] This application also provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, are used to implement the method for selecting a transcoding card implemented by the above-mentioned electronic device.

[0118] This application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the method for selecting a transcoding card as described above in the electronic device.

[0119] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0120] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method for selecting a transcoding card, characterized in that, Applied to an electronic device, wherein the electronic device is equipped with multiple hardware transcoding cards, the method includes: For each of the plurality of hardware transcoding cards, the score of each module of the hardware transcoding card is determined to obtain the score of each module contained in each hardware transcoding card, and the score is used to indicate whether the corresponding module is available. For each of the plurality of hardware transcoding cards, the total score of the hardware transcoding card is determined based on the scores of each module of the hardware transcoding card and the weights of each module of the hardware transcoding card, wherein the weights are positively correlated with the importance of the corresponding modules. A candidate list is determined based on the total score of each of the plurality of hardware transcoding cards, and the candidate list is used to indicate the available hardware transcoding cards among the plurality of hardware transcoding cards; Select the first transcoding card for the transcoding task from the candidate list.

2. The method according to claim 1, characterized in that, The step of selecting a first transcoding card from the candidate list for the transcoding task includes: Determine the process ID of the process corresponding to the transcoding task and the system timestamp of the system receiving the transcoding task; A random seed is generated based on the process ID and the system timestamp; The first transcoding card is selected from the candidate list for the transcoding task based on the random seed.

3. The method according to claim 1, characterized in that, After selecting the first transcoding card for the transcoding task from the candidate list, the process further includes: Based on the transcoding task, it is determined whether there is a first module among the modules included in the first transcoding card. The first module is a module in the first transcoding card that cannot meet the resource requirements of the transcoding task. When the first transcoding card contains the first module and the transcoding task is executed to the stage corresponding to the first module, the function of the first module is implemented using a software algorithm.

4. The method according to any one of claims 1 to 3, characterized in that, The step of determining the candidate list based on the total score of each of the plurality of hardware transcoding cards includes: For each of the plurality of hardware transcoding cards, a threshold value corresponding to the hardware transcoding card is determined, wherein the threshold value is less than or equal to the sum of the weights of each module of the hardware transcoding card; For each of the plurality of hardware transcoding cards, the candidate list is determined based on the threshold value corresponding to the hardware transcoding card and the total score of the hardware transcoding card.

5. The method according to any one of claims 1 to 3, characterized in that, For each of the plurality of hardware transcoding cards, determining the score of each module of the hardware transcoding card includes: For each of the plurality of hardware transcoding cards, determine whether there is a second module among the modules included in the hardware transcoding card. The second module is the module in the hardware transcoding card whose load exceeds a first threshold, whose number of tasks exceeds a second threshold, and / or whose remaining memory is less than a third threshold. When the second module is present among the modules included in the hardware transcoding card, the score of the second module is determined as the first score, and the score of the third module is determined as the second score. The third module is any other module in the hardware transcoding card besides the second module. The first score is used to indicate that the second module is unavailable, and the second score is used to indicate that the third module is available.

6. The method according to any one of claims 1 to 3, characterized in that, Before determining the total score of each hardware transcoding card based on the scores and weights of its modules, the method further includes: The configuration interface displays the weights of each module in each of the plurality of hardware transcoding cards. In response to operations on the configuration interface, the weight of the selected module is modified.

7. The method according to any one of claims 1 to 3, characterized in that, After determining the candidate list based on the total score of each of the plurality of hardware transcoding cards, the process further includes: When a second transcoding card exists among the plurality of hardware transcoding cards, the total score of the second transcoding card is updated. The second transcoding card is the hardware transcoding card among the plurality of hardware transcoding cards whose status information has been updated. The status information includes load, number of tasks and / or remaining memory. The candidate list is updated based on the total score of the second transcoding card.

8. The method according to any one of claims 1 to 3, characterized in that, The transcoding task is any one of the high-concurrency transcoding tasks.

9. An electronic device comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it causes the electronic device to implement the method as described in any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 8.