Access Method, Device, Storage Medium and Electronic Device of a Terminal
By adjusting the decoding value of the connected terminal in the network recorder and releasing resources according to importance to access the new terminal, the problem of insufficient decoding capabilities of the network recorder is solved, and network camera expansion is achieved under limited performance.
Patent Information
- Application Number
- CN202210109443.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-28
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2042-01-28
AI Technical Summary
In the prior art, insufficient decoding capabilities of network video recorders lead to inability to access more network cameras, especially when the bandwidth is sufficient but the video recorder performance is limited, the number of network cameras cannot be effectively expanded.
By obtaining the decoded values of the target device and the terminal to be accessed, the decoded values of the connected terminal are adjusted according to the terminal importance, sufficient decode resources are released to access the new terminal, ensuring that the adjusted remaining decoded values are greater than or equal to the decoded values of the terminal to be accessed.
In the case of insufficient decoding capabilities of network video recorders, more network cameras can be accessed, which improves the expansion capabilities of network video recorders.
Smart Images

Figure CN114501395B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of communications, and in particular, to an access method, device, storage medium, and electronic device for a terminal. Background Art
[0002] In the related art, a Network Video Recorder (NVR) and an IP Camera (IPC) are generally connected through a network. The network video recorder may include multiple channels, and the number of IP cameras corresponding to the number of channels may be accessed in the network video recorder, so as to store, forward, and display the images collected by multiple IP cameras through the network video recorder.
[0003] In the prior art, mainly according to the network bandwidth, the bitstream strategy of the network video recorder is adjusted to automatically adjust the video bitstreams of some or all channels in the current video channels, so as to ensure that when the broadband is insufficient, the network video recorder can normally process the multiple IP cameras accessed, and at the same time ensure the smooth video playback of important channels. However, when the bandwidth of the network video recorder is sufficient and the channels are sufficient, due to insufficient performance itself, such as decoding ability, or when other services are enabled on the network video recorder, the problem of inability to access more IP cameras will occur.
[0004] In view of the above problems in the related art, no effective solution has been proposed yet. Summary of the Invention
[0005] The embodiments of the present invention provide an access method, device, storage medium, and electronic device for a terminal, so as to at least solve the problem in the related art that due to insufficient decoding ability of the network video recorder, more IP cameras cannot be accessed.
[0006] According to an embodiment of the present invention, an access method for a terminal is provided, including: obtaining the current remaining decoding value of a target device and the current to-be-accessed decoding value of a to-be-accessed terminal; in a case where the current to-be-accessed decoding value is greater than the current remaining decoding value, adjusting the decoding value of a target terminal in a first terminal set according to the importance of each terminal in the first terminal set, so as to obtain the adjusted remaining decoding value of the target device, where the first terminal set includes a first terminal subset and the to-be-accessed terminal, and the first terminal subset includes the terminals currently accessing the target device; in a case where the remaining decoding value of the target device is greater than or equal to the to-be-accessed decoding value of the to-be-accessed terminal, accessing the to-be-accessed terminal to the target device.
[0007] Optionally, adjusting the decoded value of the target terminal in the first terminal set according to the importance of each terminal in the first terminal set includes: pre-adjusting the decoded value of each terminal in the first terminal set to obtain a set of released decoded values, where the set of released decoded values includes the released decoded value of each terminal after the pre-adjustment of the decoded value of each terminal; determining the target terminal in the first terminal set according to the released decoded value corresponding to each terminal in the set of released decoded values and the importance of each terminal in the first terminal set, and adjusting the decoded value of the target terminal according to the pre-adjustment.
[0008] Optionally, determining the target terminal in the first terminal set according to the released decoded value corresponding to each terminal in the set of released decoded values and the importance of each terminal in the first terminal set includes: determining the released decoded value that meets the preset condition in the set of released decoded values as the target released decoded value; determining the terminal corresponding to the target released decoded value in the first terminal set as the terminal in the second terminal subset; determining the target terminal in the second terminal subset according to the importance of each terminal in the second terminal subset.
[0009] Optionally, determining the released decoded value that meets the preset condition in the set of released decoded values as the target released decoded value includes: when pre-adjusting the decoded value of the terminal in the first terminal subset, determining the released decoded value that meets the first preset condition in the subset of released decoded values as the target released decoded value, where the subset of released decoded values includes the released decoded values obtained by pre-adjusting the decoded values of the terminals in the first terminal subset, and the set of released decoded values includes the subset of released decoded values; when pre-adjusting the currently to-be-accessed decoded value of the to-be-accessed terminal, if the first released decoded value obtained after the pre-adjustment meets the second preset condition, determining the first released decoded value as the target released decoded value; when pre-adjusting the decoded value of the terminal in the first terminal subset and the currently to-be-accessed decoded value of the to-be-accessed terminal, determining the decoded value in the subset of released decoded values that meets the third preset condition with the second released decoded value, and the second released decoded value as the target released decoded value, where the second released decoded value is the released decoded value obtained by pre-adjusting the currently to-be-accessed decoded value of the to-be-accessed terminal.
[0010] Optionally, determining the decoded value that satisfies the first preset condition in the subset of released decoded values as the target released decoded value includes: performing the following operations on each released decoded value in the subset of released decoded values, where each released decoded value during the execution of the following operations is the current released decoded value: determining the sum of the current released decoded value and the current remaining decoded value of the target device as the first sum value; in the case where the first sum value is greater than or equal to the current decoded value to be accessed of the terminal to be accessed, determining the current released decoded value as the target released decoded value.
[0011] Optionally, if the first released decoded value obtained after pre-adjustment satisfies the second preset condition, determining the first released decoded value as the target released decoded value includes: determining the sum of the first released decoded value and the current remaining decoded value as the second sum value; in the case where the second sum value is greater than or equal to the first target decoded value to be accessed, determining the first released decoded value as the target released decoded value, where the first target decoded value to be accessed is the decoded value obtained by performing the pre-adjustment on the current decoded value to be accessed of the terminal to be accessed, the decoded value to be accessed of the terminal to be accessed includes the first target decoded value to be accessed, and the first target decoded value to be accessed is equal to the difference between the current decoded value to be accessed and the first released decoded value.
[0012] Optionally, determining the target terminal in the second subset of terminals according to the importance of each terminal in the second subset of terminals includes: determining the terminal with the lowest importance in the second subset of terminals as the target terminal, where the importance includes one of the following: the total score of current opened events, the total score of event importance in the current time period, the total score of event frequency importance; or, determining the sum of at least two of the total score of current opened events, the total score of event importance in the current time period, and the total score of event frequency importance as the importance, and determining the terminal with the lowest importance in the second subset of terminals as the target terminal.
[0013] Optionally, determining the decoded value that satisfies the first preset condition in the subset of released decoded values as the target released decoded value further includes: combining at least two released decoded values in the subset of released decoded values to obtain a plurality of released decoded value combinations; obtaining the sum value of the released decoded values for each released decoded value combination to obtain a plurality of sum values of the released decoded values, where the sum value of the released decoded values is the sum of the released decoded values in the released decoded value combination; determining the released decoded values in the target released decoded value combination among the plurality of released decoded value combinations as the target released decoded value, where the sum of the sum value of the released decoded values in the target released decoded value combination and the current remaining decoded value is greater than or equal to the current decoded value to be accessed.
[0014] Optionally, determining the target terminal in the second subset of terminals according to the importance of each terminal in the second subset of terminals includes: when at least two target release decoding value combinations are included in the multiple release decoding value combinations, obtaining at least two terminal combinations corresponding to the at least two target release decoding value combinations, where each target release decoding value combination corresponds to one terminal combination, and each release decoding value in the target release decoding value combination is a release decoding value obtained by performing the pre-adjustment on the decoding value of the corresponding terminal in the corresponding terminal combination. Determining the terminal combination with the lowest importance among the at least two terminal combinations as the target terminal combination, and determining the terminals in the target terminal combination as the target terminals.
[0015] Optionally, determining the release decoding value in the subset of release decoding values that satisfies the third preset condition with the second release decoding value and the second release decoding value as the target release decoding value includes: obtaining the sum of each release decoding value in the subset of release decoding values and the second release decoding value to obtain a first sum value set; obtaining the sum of each sum value in the first sum value set and the current remaining decoding value of the target device to obtain a second sum value set; determining the sum values greater than or equal to the second target access decoding value in the second sum value set as target sum values; determining the release decoding value corresponding to the target sum value in the subset of release decoding values and the second release decoding value as the target release decoding value, where the second target access decoding value is a decoding value obtained by performing the pre-adjustment on the current access decoding value of the access terminal, the access decoding value of the access terminal includes the second target access decoding value, and the second target access decoding value is equal to the difference between the current access decoding value and the second release decoding value.
[0016] Optionally, determining the target terminal in the second subset of terminals according to the importance of each terminal in the second subset of terminals includes: when multiple target release decoding values are included in the subset of release decoding values, obtaining the combination of the terminal corresponding to each target release decoding value and the access terminal to obtain multiple terminal combinations; determining the terminal combination with the lowest importance among the multiple terminal combinations as the target terminal combination, and determining the terminals in the target terminal combination as the target terminals.
[0017] According to another embodiment of the present invention, an access device for a terminal is provided, including: an acquisition module, configured to acquire the current remaining decoding value of a target device and the current to-be-accessed decoding value of a to-be-accessed terminal; an adjustment module, configured to, when the current to-be-accessed decoding value is greater than the current remaining decoding value, adjust the decoding value of a target terminal in a first terminal set according to the importance of each terminal in the first terminal set, so as to obtain the adjusted remaining decoding value of the target device, where the first terminal set includes a first terminal subset and the to-be-accessed terminal, and the first terminal subset includes terminals currently accessing the target device; and an access module, configured to access the to-be-accessed terminal to the target device when the remaining decoding value of the target device is greater than or equal to the to-be-accessed decoding value of the to-be-accessed terminal.
[0018] According to still another embodiment of the present invention, a computer-readable storage medium is further provided. A computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, the steps of the method described in any one of the above are implemented.
[0019] According to still another embodiment of the present invention, an electronic device is further provided, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0020] Through the present invention, by acquiring the current remaining decoding value of a target device and the current accessed decoding value of a to-be-accessed terminal, when the current to-be-accessed decoding value is greater than the current remaining decoding value, the decoding values of the terminals currently accessing the target device and the to-be-accessed terminal are adjusted. When the adjusted remaining decoding value of the target device is greater than or equal to the to-be-accessed decoding value of the to-be-accessed terminal, the to-be-accessed terminal is accessed to the target device. By adjusting the decoding values of the accessed terminal and the to-be-accessed terminal, the problem in the related art that more network cameras cannot be accessed due to insufficient decoding capabilities of a network video recorder can be solved, and the effect of accessing more network cameras when the decoding capabilities of the network video recorder are insufficient can be achieved. Description of the Drawings
[0021] Figure 1 is a block diagram of the hardware structure of a mobile terminal of an access method for a terminal according to an embodiment of the present invention;
[0022] Figure 2 is a flowchart of an access method for a terminal according to an embodiment of the present invention;
[0023] Figure 3 is a block diagram of the structure of an access device for a terminal according to an embodiment of the present invention. Detailed Embodiments
[0024] Embodiments of the present invention will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence.
[0026] The method embodiments provided in the embodiments of the present application can be executed on a mobile terminal, a computer terminal, or a similar computing device. Taking running on a computer terminal as an example, Figure 1 is a hardware structure block diagram of a computer terminal for an access method of a terminal according to an embodiment of the present invention. As Figure 1 shown, the computer terminal may include one or more ( Figure 1 only one is shown in the figure) processors 102 (the processor 102 may include, but is not limited to, processing devices such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Among them, the above computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only schematic and does not limit the structure of the above computer terminal. For example, the computer terminal may further include more or fewer components than Figure 1 shown in the figure, or have a different configuration from Figure 1 shown in the figure.
[0027] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the access method of the terminal in the embodiments of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely provided relative to the processor 102, and these remote memories can be connected to the mobile terminal through a network. Examples of the above network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0028] The transmission device 106 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0029] In this embodiment, an access method for a terminal running on the above computer terminal is provided. Figure 2 It is a flowchart of the access method for a terminal according to an embodiment of the present invention. As Figure 2 shown, the process includes the following steps:
[0030] Step S202, obtain the current remaining decoding value of the target device and the current decoding value to be accessed of the terminal to be accessed;
[0031] Among them, the target device can be a network video recorder, and the terminal to be accessed can be a network camera to be accessed. The current decoding value to be accessed is the decoding value required by the network camera to be accessed. The decoding value is related to parameters such as resolution, bitstream frame rate, and trigger events. For example, the decoding value can be reduced by adjusting the resolution, or by reducing the bitstream frame rate, or by changing the trigger event. The decoding value can have a corresponding relationship with the resolution of the network camera. For example, if the resolution of the network camera is 1920*1080, the corresponding decoding value of the network video recorder can be 500, which means that the network video recorder can access the network camera with a resolution of 1920*1080 when the remaining decoding value of the network video recorder is greater than or equal to 500.
[0032] Step S204, when the current decoding value to be accessed is greater than the current remaining decoding value, adjust the decoding value of the target terminal in the first terminal set according to the importance of each terminal in the first terminal set, where the first terminal set includes a first terminal subset and the terminal to be accessed, and the first terminal subset includes the terminals currently accessing the target device;
[0033] Among them, assume that the current decoding value to be accessed is 500, and the current remaining decoding value is 300. If the network cameras currently accessing the network video camera are IPC1, IPC2, and IPC3, and the terminal to be accessed is IPC4, then the first terminal subset can be {IPC1, IPC2, IPC3}, and the first terminal set can be {IPC1, IPC2, IPC3, IPC4}. When the current decoding value to be accessed is greater than the current remaining decoding value, according to the importance of each terminal in the first terminal set, the decoding value of the target terminal in the first terminal set is adjusted. The above importance can be a value. For example, the importance of the terminal is represented by numerical values such as 1, 2, 3, etc., or the importance of the terminal can also be represented by the degree of importance. For example, excellent, good, medium, poor, etc. represent the importance of the terminal. Assume that in the first terminal set {IPC1, IPC2, IPC3, IPC4}, assume that the importance of each terminal corresponds to 60, 70, 80, and 90 respectively. Then, the target terminal whose decoding value needs to be adjusted can be determined according to the importance of each terminal. For example, the decoding value of IPC1 with the lowest importance can be adjusted, so IPC1 is the target terminal. Assume that the current decoding value of IPC1 is 500, and the decoding value of IPC1 can be adjusted to 300.
[0034] Step S206, when the remaining decoding value of the target device after adjustment is greater than or equal to the decoding value to be accessed of the terminal to be accessed, the terminal to be accessed is connected to the target device.
[0035] Among them, the target device can be a network video recorder. Assume that the current remaining decoding value of the network video recorder is 300, the decoding value to be accessed of the terminal to be accessed IPC4 is 500, and the current decoding value of the target terminal IPC1 is 500. The decoding value of IPC1 can be adjusted to 300. Then, the remaining decoding value of the network video recorder after adjustment becomes 500. At this time, the remaining decoding value is equal to the decoding value to be accessed 500 of the terminal to be accessed IPC4, and the terminal to be accessed IPC4 can be connected to the network video recorder.
[0036] Optionally, the execution subject of the above steps can be a background processor, or other devices with similar processing capabilities, or a machine integrating at least an image acquisition device and a data processing device. Among them, the image acquisition device can include graphic acquisition modules such as cameras, and the data processing device can include terminals such as computers and mobile phones, but is not limited thereto.
[0037] Through the above steps, by obtaining the current remaining decoding value of the target device and the currently accessed decoding value of the terminal to be accessed, when the currently to-be-accessed decoding value is greater than the current remaining decoding value, the decoding values of the terminal currently accessing the target device and the terminal to be accessed are adjusted. When the remaining decoding value of the adjusted target device is greater than or equal to the to-be-accessed decoding value of the terminal to be accessed, the terminal to be accessed is connected to the target device. By adjusting the decoding values of the already-connected terminal and the terminal to be accessed, the problem in the related art that due to the insufficient performance of the network video recorder, more network cameras cannot be connected can be solved, and the effect that more network cameras can be connected when the performance of the network video recorder is insufficient can be achieved.
[0038] Optionally, the adjusting the decoding value of the target terminal in the first terminal set according to the importance of each terminal in the first terminal set includes: pre-adjusting the decoding value of each terminal in the first terminal set to obtain a released decoding value set, where the released decoding value set includes the released decoding value of each terminal after the pre-adjustment of the decoding value of each terminal; determining the target terminal in the first terminal set according to the released decoding value corresponding to each terminal in the released decoding value set and the importance of each terminal in the first terminal set, and adjusting the decoding value of the target terminal according to the pre-adjustment.
[0039] As an optional implementation manner, assume that the terminals in the first terminal set are IPC1 and IPC2, the corresponding decoding values are 500 and 800, and the corresponding importance levels are 60 and 70. The decoding values of each terminal in the first terminal set are pre-adjusted. The pre-adjustment can be to reduce the decoding value of each terminal. It should be noted that the pre-adjustment is to calculate the decoding value of each terminal and does not actually trigger the action of adjusting the decoding value. After reducing the decoding value of each terminal, a released decoding value set can be obtained. For example, by reducing the decoding value of IPC1 by 300, the released decoding value K1 corresponding to IPC1 can be obtained as 300, and by reducing the decoding value of IPC2 by 100, the released decoding value K2 corresponding to IPC2 can be obtained as 100. The released decoding value set {K1 = 300, K2 = 100} can be obtained through the pre-adjustment operation of reducing the decoding value of each terminal. The target terminal whose decoding value needs to be adjusted can be determined by comparing the importance levels of IPC1 and PC2. For example, IPC1 with the lowest importance level can be determined as the target terminal, that is, reducing the decoding value of IPC1 by 300.
[0040] Optionally, determining the target terminal from the first terminal set according to the release decoding value corresponding to each terminal in the release decoding value set and the importance of each terminal in the first terminal set includes: determining the release decoding value that meets a preset condition in the release decoding value set as the target release decoding value; determining the terminal corresponding to the target release decoding value in the first terminal set as the terminal in the second terminal subset; and determining the target terminal from the second terminal subset according to the importance of each terminal in the second terminal subset.
[0041] As an optional implementation manner, assume that the first terminal set includes IPC1, IPC2, IPC3, and IPC4, where the connected terminals include IPC1, IPC2, and IPC3, and the to-be-connected terminal is IPC4. Perform pre-adjustment on the decoding values of each terminal in the first terminal set. The pre-adjustment can be to reduce the decoding value of each terminal to obtain the release decoding value set. Assume that the decoding values of IPC1, IPC2, IPC3, and PC4 before pre-adjustment are 900, 800, 600, and 500. By pre-adjusting to reduce the decoding value of each terminal, the corresponding release decoding value set obtained is 300, 250, 150, and 200. Assume that the total decoding capacity value of the network video recorder is N, the total decoding value M required to cache the network cameras of all current channels, the decoding value of the to-be-connected terminal is Ax, and the release decoding value in the release decoding value set is Kn, where n is the total number of decoding values in the release decoding value set. Then the preset condition can be N–M+Kn>=Ax. For example, in this embodiment, the number n of decoding values in the release decoding value set is 4. K1 represents the release decoding value 300 corresponding to IPC1, K2 represents the release decoding value 250 corresponding to IPC2, K3 represents the release decoding value 150 corresponding to IPC3, and K4 represents the release decoding value 200 corresponding to the to-be-connected terminal IPC4. Assume that N is 2600, M is 900 + 800 + 600 which is 2300, and Ax is 500. Calculate the release decoding value Kn that satisfies N–M+Kn>=Ax, that is, calculate the release decoding value Kn greater than or equal to 200. The release decoding values 300 corresponding to K1, 250 corresponding to K2, and 200 corresponding to K4 can be obtained. Then determine K1, K2, and K4 as the target release decoding values. The terminals corresponding to the target release decoding values in the first terminal set are IPC1, IPC2, and IPC4. Determine IPC1, IPC2, and IPC4 as the terminals in the second terminal subset. Assume that the importance corresponding to IPC1, IPC2, and IPC4 is 60, 70, and 80. The terminal with the lowest importance can be determined as the target terminal.
[0042] Optionally, determining the release decoding value that meets the preset condition in the set of release decoding values as the target release decoding value includes: when performing the pre-adjustment on the decoding values of the terminals in the first terminal subset, determining the release decoding value that meets the first preset condition in the release decoding value subset as the target release decoding value, where the release decoding value subset includes the release decoding values obtained by performing the pre-adjustment on the decoding values of the terminals in the first terminal subset, and the set of release decoding values includes the release decoding value subset; when performing the pre-adjustment on the current to-be-accessed decoding value of the to-be-accessed terminal, if the first release decoding value obtained after the pre-adjustment meets the second preset condition, determining the first release decoding value as the target release decoding value; when performing the pre-adjustment on the decoding values of the terminals in the first terminal subset and the current to-be-accessed decoding value of the to-be-accessed terminal, determining the decoding value in the release decoding value subset that meets the third preset condition with the second release decoding value, and the second release decoding value as the target release decoding value, where the second release decoding value is the release decoding value obtained by performing the pre-adjustment on the current to-be-accessed decoding value of the to-be-accessed terminal.
[0043] As an optional implementation manner, the target device may be a network video recorder. Assume that IPC1, IPC2, and IPC3 are the terminals that have been connected to the target device, and IPC4 is the terminal to be connected to the target device. The first terminal set includes IPC1, IPC2, IPC3, and IPC4, and the corresponding set of release decoding values includes 300, 250, 150, and 200. The first terminal subset includes IPC1, IPC2, and IPC3.
[0044] Assume that the total decoding capability value of the network video recorder is N, the total decoding value required to cache the network cameras of all current channels is M, the remaining decoding value of the target device is N - M, the to-be-accessed decoding value of the to-be-accessed terminal is Ax, the release decoding value in the release decoding value subset is Kn', and the first preset condition may be N - M + Kn' >= Ax. For example, in this embodiment, the release decoding values in the release decoding value subset include 300, 250, and 150. K1' represents the release decoding value 300 corresponding to IPC1, K2' represents the release decoding value 250 corresponding to IPC2, and K3' represents the release decoding value 150 corresponding to IPC3. Assume that N takes the value of 2600, M takes the value of 900 + 800 + 600 which is equal to 2300, and Ax takes the value of 500. The release decoding value Kn' that satisfies N - M + Kn' >= Ax can be calculated, that is, the release decoding value Kn' greater than or equal to 200 is calculated. The K1' corresponding to the release decoding value 300 and the K2' corresponding to the release decoding value 250 can be obtained, and then K1' and K2' are determined as the target release decoding values.
[0045] Suppose the total decoding capacity value of the network video recorder is N, the total decoding value M required to cache the network cameras of all current channels, the remaining decoding value of the target device is N - M, the decoding value to be accessed for the terminal to be accessed is Ax, and the first released decoding value is Kx. Then the second preset condition can be N – M + Kx >= Ax. For example, in this embodiment, Kx represents the first released decoding value 200 corresponding to IPC4. Suppose N is 2600, M is 2300, and Ax is 500. It can be calculated whether the released decoding value Kx satisfies N – M + Kx >= Ax, that is, calculate whether the released decoding value Kx satisfies being greater than or equal to 200 (Ax - N + M = 500 - 2600 + 2300 = 200). In this embodiment, Kx is equal to 200, that is, it satisfies the condition of being greater than or equal to 200. Therefore, Kx can be determined as the target released decoding value.
[0046] Suppose IPC1, IPC2, and IPC3 are the terminals already connected to the target device, and IPC4 is the terminal to be connected to the target device. The first terminal subset includes IPC1, IPC2, and IPC3. By pre-adjusting the decoding values of the terminals in the first terminal subset, a released decoding value subset including 300, 250, and 150 can be obtained. By pre-adjusting the current decoding value to be accessed of the terminal to be accessed IPC4, a second released decoding value 200 can be obtained. Suppose the total decoding capacity value of the network video recorder is N, the total decoding value M required to cache the network cameras of all current channels, the current remaining decoding value of the target device is N - M, the decoding value of the terminal to be accessed is Ax, the second released decoding value is Kx, and the released decoding values in the released decoding value subset can be represented by Kn’. Then the third preset condition can be N – M + Kn’ + Kx >= Ax. For example, in this embodiment, the released decoding values in the released decoding value subset include 300, 250, and 150. K1’ represents the released decoding value 300 corresponding to IPC1, K2’ represents the released decoding value 250 corresponding to IPC2, K3’ represents the released decoding value 150 corresponding to IPC3, and Kx represents the second released decoding value 200 corresponding to IPC4. Suppose N is 2600, M is 2300, and Ax is 500. It can be calculated the released decoding value Kn’ + Kx that satisfies N – M + Kn’ + Kx >= Ax, that is, calculate the released decoding value Kn’ + Kx that satisfies being greater than or equal to 200 (Ax - N + M = 500 - 2600 + 2300 = 200). The Kn’ that satisfies Kn’ + Kx being greater than or equal to 200 can be obtained, that is, K1’ corresponding to the released decoding value 300, K2’ corresponding to the released decoding value 250, and K3’ corresponding to the released decoding value 150. Then K1’, K2’, K3’, and the second released decoding value Kx are determined as the target released decoding values.
[0047] Optionally, determining the decoded value that satisfies the first preset condition in the subset of decoded values to be released as the target decoded value to be released includes: performing the following operations on each decoded value to be released in the subset of decoded values to be released, where each decoded value to be released during the execution of the following operations is the current decoded value to be released: determining the sum of the current decoded value to be released and the current remaining decoded value of the target device as the first sum value; in the case where the first sum value is greater than or equal to the current decoded value to be accessed of the terminal to be accessed, determining the current decoded value to be released as the target decoded value to be released.
[0048] As an optional implementation manner, the target device may be a network video recorder. Assume that the total decoding capability value of the network video recorder is N, the total decoded value M required to cache the network cameras of all current channels is cached, then the current remaining decoded value is N - M, the current decoded value to be accessed of the terminal to be accessed is Ax, and the current decoded value to be released in the subset of decoded values to be released is Kn'. Determining the sum of the current decoded value to be released and the current remaining decoded value of the target device as the first sum value, that is, determining Kn' + N - M as the first sum value. In the case where the first sum value is greater than or equal to the current decoded value to be accessed Ax of the terminal to be accessed, that is, when N – M + Kn' >= Ax is satisfied, the current decoded value to be released Kn' may be determined as the target decoded value to be released. For example, in this embodiment, the decoded values to be released in the subset of decoded values to be released include 300, 250, and 150. K1' represents the decoded value to be released 300 corresponding to IPC1, K2' represents the decoded value to be released 250 corresponding to IPC2, and K3' represents the decoded value to be released 150 corresponding to IPC3. Assume that N takes a value of 2600 and M takes a value of 2300, then the remaining decoded value is 2600 - 2300 which is equal to 300, and Ax takes a value of 500. The decoded value to be released Kn' that satisfies N – M + Kn' >= Ax can be calculated, that is, the decoded value to be released Kn' that is greater than or equal to 200 can be calculated. The K1' corresponding to the decoded value to be released 300 and the K2' corresponding to the decoded value to be released 250 can be obtained, and then K1' and K2' are determined as the target decoded values to be released.
[0049] Optionally, if the first decoded value to be released obtained after pre-adjustment satisfies the second preset condition, determining the first decoded value to be released as the target decoded value to be released includes: determining the sum of the first decoded value to be released and the current remaining decoded value as the second sum value; in the case where the second sum value is greater than or equal to the decoded value to be accessed of the terminal to be accessed, determining the first decoded value to be released as the target decoded value to be released.
[0050] As an optional implementation, the target device may be a network video recorder. Assume that the total decoding capacity value of the network video recorder is N, the total decoding value M required to cache all current channels of network cameras, the remaining decoding value of the target device is N - M, the decoding value to be accessed of the terminal to be accessed is Ax, and the first released decoding value is Kx. The sum of the first released decoding value and the current remaining decoding value can be determined as the second sum value, that is, N–M + Kx is determined as the second sum value. When the second sum value is greater than or equal to the decoding value Ax to be accessed of the terminal to be accessed, the first released decoding value is determined as the target released decoding value. For example, in this embodiment, Kx represents the first released decoding value 200 corresponding to the terminal to be accessed IPC4. Assume that N is 2600, M is 2300, and Ax is 500. It can be calculated whether the released decoding value Kx satisfies N–M + Kx >= Ax, that is, calculate whether the released decoding value Kx satisfies being greater than or equal to 200 (Ax - N + M = 500 - 2600 + 2300 = 200). In this embodiment, Kx is equal to 200, that is, it satisfies the condition of being greater than or equal to 200. Therefore, Kx can be determined as the target released decoding value.
[0051] Optionally, determining the target terminal in the second terminal subset according to the importance of each terminal in the second terminal subset includes: determining the terminal with the lowest importance in the second terminal subset as the target terminal, where the importance includes one of the following: the total score of current opening events, the total score of event importance in the current time period, the total score of event frequency importance; or, determining the sum of at least two scores among the total score of current opening events, the total score of event importance in the current time period, and the total score of event frequency importance as the importance, and determining the terminal with the lowest importance in the second terminal subset as the target terminal.
[0052] As an optional implementation, assume that the second terminal subset includes IPC1, IPC2, and IPC3, and the corresponding importance levels are 60, 70, and 80 respectively. The terminal with the lowest importance in the second terminal subset can be determined as the target terminal. In this embodiment, the importance includes the total score of current opening events, the total score of event importance in the current time period, and the total score of event frequency importance. When calculating the importance of the terminals in the second terminal subset, the importance of the terminals can be determined according to any one of the three scores of the total score of current opening events, the total score of event importance in the current time period, and the total score of event frequency importance. For example, only the total scores of current opening events corresponding to IPC1, IPC2, and IPC3 can be calculated. Assume that the total scores of current opening events corresponding to IPC1, IPC2, and IPC3 are 5, 8, and 10 respectively. Then it can be determined that the one with the lowest importance is IPC1.
[0053] In another optional embodiment, the importance of the terminal may be determined according to any two of the three scores: the total score of current activation event, the total score of event importance in the current time period, and the total score of event frequency importance. For example, the total score of current activation event and the total score of event importance in the current time period corresponding to IPC1, IPC2, and IPC3 may be calculated to determine the importance of the terminal. Assuming that the importance (total score of current activation event + total score of event importance in the current time period) corresponding to IPC1, IPC2, and IPC3 are 10, 16, and 20 respectively, it can be determined that the one with the lowest importance is IPC1.
[0054] In yet another optional embodiment, the importance of the terminal may be determined according to the three scores: the total score of current activation event, the total score of event importance in the current time period, and the total score of event frequency importance. For example, the total score of current activation event, the total score of event importance in the current time period, and the total score of event frequency importance corresponding to IPC1, IPC2, and IPC3 may be calculated to determine the importance of the terminal. Assuming that the importance (total score of current activation event + total score of event importance in the current time period + total score of event frequency importance) corresponding to IPC1, IPC2, and IPC3 are 15, 24, and 30 respectively, it can be determined that the one with the lowest importance is IPC1.
[0055] Optionally, the step of determining the target release decoding value by determining the decoding values in the release decoding value subset that meet the first preset condition further includes: combining at least two release decoding values in the release decoding value subset to obtain a plurality of release decoding value combinations; obtaining the sum value of the release decoding values for each release decoding value combination, resulting in a plurality of release decoding value sum values, where the release decoding value sum value is the sum of the release decoding values in the release decoding value combination; determining the release decoding value in the target release decoding value combination among the plurality of release decoding value combinations as the target release decoding value, where the sum of the release decoding value sum value of the target release decoding value combination and the current remaining decoding value is greater than or equal to the current decoding value to be accessed.
[0056] As an optional implementation, assume that the total decoding capacity value of the network video recorder is N, the total decoding value M required to cache all current channels of network cameras, then the current remaining decoding value of the target device is N - M. The released decoding value subset includes K1, K2, K3, and K4, and the currently to-be-accessed decoding value of the currently to-be-accessed terminal is Ax. The released decoding values corresponding to at least two different already-accessed terminals can be combined to obtain the sum value of the released decoding value combinations. For example, it can be a combination of two released decoding values, and the sum value can be K1 + K2, K1 + K3, and K2 + K3, etc. It can also be a combination of three released decoding values, and the sum value can be K1 + K2 + K3, K1 + K3 + K4, and K2 + K3 + K4, etc. The released decoding values in multiple released decoding value combinations can be determined as the target released decoding values. For example, assume that two released decoding values are used for combination, and the sum value is represented by Kn1 + Kn2. Among them, Kn1 and Kn2 can represent the released decoding values corresponding to two different terminals in the released decoding value subset. All released decoding value combinations that satisfy Kn1 + Kn2 + N - M >= Ax can be determined as the target released decoding value combinations. For example, the target released decoding value combinations are K1 + K2, K1 + K3. The released decoding values K1, K2, and K3 in the target released decoding value combinations are determined as the target released decoding values.
[0057] Optionally, the determining the target terminal from the second terminal subset according to the importance of each terminal in the second terminal subset includes: when at least two of the target released decoding value combinations are included in the multiple released decoding value combinations, obtaining at least two terminal combinations corresponding to the at least two target released decoding value combinations, where each target released decoding value combination corresponds to one terminal combination, and each released decoding value in the target released decoding value combination is the released decoding value obtained after the pre-adjustment of the decoding value of the corresponding terminal in the corresponding terminal combination. Determining the terminal combination with the lowest importance in the at least two terminal combinations as the target terminal combination, and determining the terminals in the target terminal combination as the target terminals.
[0058] As an optional implementation, assume that the total decoding capacity value of the network video recorder is N, and the total decoding value M required to cache the network cameras of all current channels. Then the current remaining decoding value of the target device is N - M, and the current decoding value to be accessed by the current terminal to be accessed is Ax. When there are at least two target release decoding value combinations in the multiple release decoding value combinations, obtain at least two terminal combinations corresponding to the at least two target release decoding value combinations. For example, when there are two target release decoding value combinations K1 + K2 and K1 + K3 in the multiple release decoding value combinations, the terminal combination IPC1 + IPC2 corresponding to the target release decoding value combination K1 + K2 can be obtained, and the terminal combination IPC1 + IPC3 corresponding to the target release decoding value combination K1 + K3. Determine the terminal combination with the lowest importance in the two terminal combinations as the target terminal combination, and determine the terminals in the target terminal combination as the target terminals. Assume that the importance of the terminal combination IPC1 + IPC2 is 100, and the importance of the terminal combination corresponding to the terminal combination IPC1 + IPC3 is 120. Then the terminal combination IPC1 + IPC2 with the lowest importance can be determined as the target terminal combination, and the terminals IPC1 and IPC2 in the target terminal combination can be determined as the target terminals.
[0059] Optionally, the step of determining the decoding value in the release decoding value subset that satisfies the third preset condition with the second release decoding value and the second release decoding value as the target release decoding value includes: obtaining the sum of each release decoding value in the release decoding value subset and the second release decoding value to obtain a first sum value set; obtaining the sum of each sum value in the first sum value set and the current remaining decoding value of the target device to obtain a second sum value set; determining the sum value in the second sum value set that is greater than or equal to the decoding value to be accessed by the terminal to be accessed as the target sum value; and determining the release decoding value corresponding to the target sum value in the release decoding value subset and the second release decoding value as the target release decoding value.
[0060] As an optional implementation, the target device may be a network video recorder. Assume that the second release decoding value of the to-be-connected terminal is Kx. The total decoding capacity value of the network video recorder is N, the total decoding value M required to cache all current channels of network cameras, the current remaining decoding value of the target device is N - M, the decoding value of the current to-be-connected terminal is Ax, and each release decoding value in the release decoding value subset can be represented by Kn'. Then, the sum of each release decoding value in the release decoding value subset and the second release decoding value can be determined as the first sum value set, that is, the first sum value set can be represented by Kn' + Kx. Assume that the release decoding value subset includes K1', K2', and K3'. Then, the first sum value set includes K1' + Kx, K2' + Kx, and K3' + Kx. The second sum value set includes N - M + K1' + Kx, N - M + K2 + Kx, and N - M + K3' + Kx. The sum value in the second sum value set that satisfies N - M + Kn' + Kx >= Ax is determined as the target sum value. For example, in the case where N - M + K1' + Kx > Ax, N - M + K2' + Kx = Ax, and N - M + K3' + Kx < Ax, N - M + K1' + Kx and N - M + K2' + Kx are determined as the target sum values. The release decoding values (K1' and K2') in the release decoding value subset K1', K2', and K3' corresponding to the target sum values, and the second release decoding value (Kx) are determined as the target release decoding values, that is, the target release decoding values are K1', K2', and Kx.
[0061] Optionally, the determining the target terminal in the second terminal subset according to the importance of each terminal in the second terminal subset includes: when there are multiple target release decoding values in the release decoding value subset, obtaining the combination of each target release decoding value corresponding terminal and the to-be-connected terminal to obtain multiple terminal combinations; determining the terminal combination with the lowest importance in the multiple terminal combinations as the target terminal combination, and determining the terminal in the target terminal combination as the target terminal.
[0062] As an alternative implementation, the target device may be a network video recorder. Assume that the second release decoding value of the terminal to be connected is Kx. The total decoding capacity value of the network video recorder is N, the total decoding value M required to cache all current channels of network cameras, the current remaining decoding value of the target device is N - M, the decoding value of the current terminal to be connected is Ax, and each release decoding value in the release decoding value subset can be represented by Kn'. Assume that the release decoding value subset includes K1', K2', K3'. If the target release decoding values are K1', K2' and Kx, then it can be determined that there are two target release decoding values K1' and K2' in the release decoding value subset. By obtaining the combinations of the terminals corresponding to each target release decoding value and the terminal to be connected, two terminal combinations can be obtained. Assume that the terminals corresponding to K1', K2' and Kx are IPC1, IPC2 and IPC4 respectively, where IPC4 is the terminal to be connected. IPC1, IPC2 and IPC4 can be combined to obtain two terminal combinations IPC1 + IPC4 and IPC2 + IPC4. Assume that the importance of the terminal combination IPC1 + IPC4 is 100 and the importance of the terminal combination IPC2 + IPC4 is 120. Then the terminal combination IPC1 + IPC4 with the lowest importance can be determined as the target terminal combination, and the terminals IPC1 and IPC4 in the target terminal combination can be determined as the target terminals.
[0063] As an alternative implementation, the single-channel importance of a network camera may include the total score of current opening events, the total score of event importance in the current time period, and the total score of event frequency importance. The single-channel importance of the network camera can be set in the following manner:
[0064] (1) Setting the total score of current opening events
[0065] Set scores for single-channel opening events of the network video recorder. The events are mainly motion detection events, face detection, face recognition, and license plate recognition events, which are represented by Emdn, Efdn, Efrn, and Eprn respectively, where n represents the channel number. Set the scores of each event as (the score of an unopened event is 0): motion detection (Emdn): 5, face detection (Efdn): 8, face recognition (Efrn): 10, license plate recognition (Eprn): 8. Therefore, the total score of current opening events for a single channel (represented by E) is: En = Emdn + Efdn + Efrn + Eprn.
[0066] (2) Setting the total score of event importance in the current time period
[0067] Set the importance for the event segments when events occur, represented by Tmdn, Tfdn, Tfrn, and Tprn respectively, where n represents the channel number. Divide 24 hours of a day into 3 event segments, namely 0:00 - 8:00, 8:00 - 16:00, and 17:00 - 24:00. The score settings for each time period are shown in Table 1:
[0068] Table 1
[0069] 0:00 - 8:00 8:00 - 16:00 16:00 - 24:00 Dynamic inspection 5 5 5 Face detection 8 5 8 Face recognition 10 10 10 License plate recognition 8 5 8
[0070] Therefore (taking face detection as an example), the value of Tfdn is divided according to different time points (when the event is not enabled, Tfdn = 0): 0:00 - 8:00: Tfdn = 8, 8:00 - 16:00: Tfdn = 5, 16:00 - 24:00: Tfdn = 8. Therefore, the total score of the importance of the current time period for a single channel (represented by T) is: Tn = Tmdn + Tfdn + Tfrn + Tprn.
[0071] (3) Setting the total score of the importance of event frequency
[0072] Set the importance according to the frequency of event triggering for a unit event (1 hour), represented by Qmdn, Qfdn, Qfrn, and Qprn respectively, where n represents the channel number. The triggering frequency segments are: 1 - 5 times, 6 - 10 times, 11 - 20 times, and more than 20 times. The score settings for each segment are shown in Table 2:
[0073] Table 2
[0074] 1 - 5 times 6 - 10 times 11 - 20 times More than 20 times Dynamic inspection 1 2 4 10 Face detection 2 4 6 10 Face recognition 3 6 8 10 License plate recognition 2 4 6 10
[0075] Therefore (taking face detection as an example), the value of Qfdn is divided according to different triggering frequencies (when the event is not enabled, Qfdn = 0): 1 - 5 times: Qfdn = 2, 6 - 10 times: Qfdn = 4, 11 - 20 times: Qfdn = 6, more than 20 times: Qfdn = 10. Therefore, the total score of the importance of event frequency for a single channel (represented by Q) is: Qn = Qmdn + Qfdn + Qfrn + Qprn.
[0076] Therefore, when calculating the importance of the channel corresponding to the network camera of the network video recorder at a certain time point (represented by Pn, where n represents the channel number), determine the total score of the currently enabled events (determine En), determine the total score of the importance of the current time period for each event (determine Tn), determine the total score of the importance of the frequency of each event (determine Qn), and the importance corresponding to each network camera (terminal) can be obtained: Pn = En + Tn + Qn.
[0077] When a new IPC is connected, the network video recorder calculates the relevant information of each currently connected IPC, including: the decoding values supported by each connected IPC, and each decoding ability value can represent one level. For example, it can support decoding ability values of 300, 500, and 800. At the same time, it determines the current decoding value of each connected IPC. When a new IPC needs to be connected, it calculates that the currently required decoding value of the new IPC is Ax. Assume that the total decoding ability value of the network video recorder is N, and the total decoding value M required by all the network cameras in the current cache is calculated. When the remaining decoding value of the target device (network video recorder) is not enough for the new IPC to be connected, that is, when N–M<Ax, the following steps are executed:
[0078] Step 1, calculate the importance Px of the IPC to be connected, where the importance value of the channel event is Ex, the score of the current time period of the event is Tx, and the score of the current frequency of the time is Qx.
[0079] Step 2, calculate for each IPC in the network video recorder (including the new IPC to be connected) the decoding ability value Kn that can be released if the decoding value of the IPC is reduced by one level (n represents the channel number and includes the new IPC).
[0080] Step 3, based on the Kn calculated in Step 2, determine the Kn values that satisfy N–M+Kn>Ax, and select the smallest 5 values (if less than 5, select all; if none meet the requirements, go to Step 4). Among these 5 IPCs, select a channel with the lowest Pn (importance of a single channel) to reduce the decoding value to ensure that the new IPC to be connected can be normally connected. If there is no Kn that meets the conditions, continue to execute Step 4.
[0081] Step 4, based on Step 2, calculate whether there is a combination of decoding values Kn1+Kn2 that can satisfy N–M+Kn1+Kn2>Ax. If there is no Kn1+Kn2 that meets the requirements, go to Step 5. If there is a Kn1+Kn2 that meets the requirements, select the combination with the lowest corresponding terminal importance Pn1+Pn2 among these combinations for the operation of reducing the decoding value.
[0082] Step 5, similar to Step 2, after attempting to reduce by two levels (reduce more decoding values), check whether there is a released decoding ability value Kn (n represents the channel number and includes the new IPC) that satisfies N–M+Kn>Ax, and repeat the operations of Step 3 and Step 4.
[0083] Step 6, if the above operations cannot meet the requirements, prompt that the new IPC cannot be connected due to exceeding the decoding ability.
[0084] In the above manner, by calculating and reducing the decoding value of one gear of one terminal, it is determined whether there is a Kn value that meets the conditions. If there is no Kn value that meets the conditions, the decoding values of reducing one gear of two terminals, reducing two gears of one terminal, and reducing two gears of two terminals are calculated in sequence until a Kn value that can release enough decoding values to access a new IPC is found. If no Kn value that meets the conditions can be found through the above manner, it is prompted that the decoding capacity is exceeded and the new IPC cannot be accessed.
[0085] Through the present invention, it is not limited to external environmental factors such as network bandwidth, but according to the performance of the network video recorder itself, a strategy for automatically adjusting the IPC bitstream is realized. It can calculate the importance according to different channels and different dimensions, and automatically adjust the quantity and quality of the accessed IPCs to ensure that the network video recorder can display and record more and more important information. It can calculate the importance of the accessed IPCs according to, but not limited to, different intelligent events, time period dimensions, trigger frequency dimensions, etc., according to the algorithm strategy, and reduce the decoding value of the accessed device with low importance to reach the condition of accessing a new IPC.
[0086] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc), and includes several instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present invention.
[0087] In this embodiment, an access device for a terminal is further provided. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0088] Figure 3 is a structural block diagram of the access device for a terminal according to an embodiment of the present invention, as Figure 3As shown, the device includes an acquisition module 32 for acquiring the current remaining decoding value of the target device and the current to-be-accessed decoding value of the to-be-accessed terminal; an adjustment module 34 for, when the current to-be-accessed decoding value is greater than the current remaining decoding value, adjusting the decoding value of the target terminal in the first terminal set according to the importance of each terminal in the first terminal set to obtain the adjusted remaining decoding value of the target device, where the first terminal set includes a first terminal subset and the to-be-accessed terminal, and the first terminal subset includes the terminals currently accessing the target device; and an access module 36 for, when the remaining decoding value of the target device is greater than or equal to the to-be-accessed decoding value of the to-be-accessed terminal, accessing the to-be-accessed terminal to the target device.
[0089] Optionally, the above device is further configured to pre-adjust the decoding value of each terminal in the first terminal set to obtain a set of released decoding values, where the set of released decoding values includes the released decoding value of each terminal after the pre-adjustment of the decoding value of each terminal; determine the target terminal in the first terminal set according to the released decoding value corresponding to each terminal in the set of released decoding values and the importance of each terminal in the first terminal set, and adjust the decoding value of the target terminal according to the pre-adjustment.
[0090] Optionally, the above device is further configured to determine the released decoding value that meets the preset condition in the set of released decoding values as the target released decoding value; determine the terminal corresponding to the target released decoding value in the first terminal set as the terminal in the second terminal subset; and determine the target terminal in the second terminal subset according to the importance of each terminal in the second terminal subset.
[0091] Optionally, the above-mentioned device is further configured to, when pre-adjusting the decoded values of the terminals in the first terminal subset, determine the release decoded values that meet the first preset condition in the release decoded value subset as the target release decoded values, where the release decoded value subset includes the release decoded values obtained by pre-adjusting the decoded values of the terminals in the first terminal subset, and the release decoded value set includes the release decoded value subset; when pre-adjusting the currently to-be-accessed decoded value of the to-be-accessed terminal, if the first release decoded value obtained after the pre-adjustment meets the second preset condition, determine the first release decoded value as the target release decoded value; when pre-adjusting the decoded values of the terminals in the first terminal subset and the currently to-be-accessed decoded value of the to-be-accessed terminal, determine the decoded values in the release decoded value subset that meet the third preset condition with the second release decoded value, and the second release decoded value as the target release decoded values, where the second release decoded value is the release decoded value obtained by pre-adjusting the currently to-be-accessed decoded value of the to-be-accessed terminal.
[0092] Optionally, the above-mentioned device is further configured to perform the following operations on each release decoded value in the release decoded value subset. When each release decoded value during the execution of the following operations is the current release decoded value: determine the sum of the current release decoded value and the current remaining decoded value of the target device as the first sum value; when the first sum value is greater than or equal to the currently to-be-accessed decoded value of the to-be-accessed terminal, determine the current release decoded value as the target release decoded value.
[0093] Optionally, the above-mentioned device is further configured to determine the sum of the first release decoded value and the current remaining decoded value as the second sum value; when the second sum value is greater than or equal to the to-be-accessed decoded value of the to-be-accessed terminal, determine the first release decoded value as the target release decoded value.
[0094] Optionally, the above-mentioned device is further configured to determine the terminal with the lowest importance in the second terminal subset as the target terminal, where the importance includes one of the following: the total score of currently enabled events, the total score of event importance in the current time period, the total score of event frequency importance; or, determine the sum of at least two of the total score of currently enabled events, the total score of event importance in the current time period, and the total score of event frequency importance as the importance, and determine the terminal with the lowest importance in the second terminal subset as the target terminal.
[0095] Optionally, the above device is further configured to combine at least two release decoded values in the release decoded value subset to obtain a plurality of release decoded value combinations; obtain the release decoded value and value of each release decoded value combination to obtain a plurality of release decoded value and values, where the release decoded value and value is the sum value of the release decoded values in the release decoded value combination; determine the release decoded value in the target release decoded value combination in the plurality of release decoded value combinations as the target release decoded value, where the sum of the release decoded value and value of the target release decoded value combination and the current remaining decoded value is greater than or equal to the current decoding value to be accessed.
[0096] Optionally, when there are at least two target release decoded value combinations in the plurality of release decoded value combinations, the above device is further configured to obtain at least two terminal combinations corresponding to the at least two target release decoded value combinations, where each target release decoded value combination corresponds to one terminal combination, and each release decoded value in the target release decoded value combination is the release decoded value obtained after pre-adjusting the decoded value of the corresponding terminal in the corresponding terminal combination. Determine the terminal combination with the lowest importance in the at least two terminal combinations as the target terminal combination, and determine the terminal in the target terminal combination as the target terminal.
[0097] Optionally, the above device is further configured to obtain the sum of each release decoded value in the release decoded value subset and the second release decoded value to obtain a first sum value set; obtain the sum of each sum value in the first sum value set and the current remaining decoded value of the target device to obtain a second sum value set; determine the sum value greater than or equal to the decoding value to be accessed of the terminal to be accessed in the second sum value set as the target sum value; determine the release decoded value corresponding to the target sum value in the release decoded value subset and the second release decoded value as the target release decoded value.
[0098] Optionally, when there are a plurality of target release decoded values in the release decoded value subset, the above device is further configured to obtain the combination of the terminal corresponding to each target release decoded value and the terminal to be accessed to obtain a plurality of terminal combinations; determine the terminal combination with the lowest importance in the plurality of terminal combinations as the target terminal combination, and determine the terminal in the target terminal combination as the target terminal.
[0099] It should be noted that the above-mentioned modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to this: the above-mentioned modules are all located in the same processor; or, the above-mentioned modules are respectively located in different processors in any combination form.
[0100] Embodiments of the present invention also provide a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in any one of the above are implemented.
[0101] Optionally, in this embodiment, the above storage medium may be configured to store a computer program for performing the following steps:
[0102] S1, obtain the current remaining decoding value of the target device and the current to-be-connected decoding value of the to-be-connected terminal;
[0103] S2, when the current to-be-connected decoding value is greater than the current remaining decoding value, adjust the decoding value of the target terminal in the first terminal set according to the importance of each terminal in the first terminal set, to obtain the adjusted remaining decoding value of the target device, where the first terminal set includes a first terminal subset and the to-be-connected terminal, and the first terminal subset includes the terminals currently connected to the target device;
[0104] S3, when the remaining decoding value of the target device is greater than or equal to the to-be-connected decoding value of the to-be-connected terminal, connect the to-be-connected terminal to the target device.
[0105] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media such as USB flash drives, read-only memories (ROMs for short), random access memories (RAMs for short), mobile hard disks, magnetic disks, or optical discs that can store computer programs.
[0106] Embodiments of the present invention also provide an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0107] In an exemplary embodiment, the above electronic device may further include a transmission device and input / output devices. The transmission device is connected to the above processor, and the input / output devices are connected to the above processor.
[0108] Optionally, in this embodiment, the above processor may be configured to execute the following steps through a computer program:
[0109] S1, obtain the current remaining decoding value of the target device and the current to-be-connected decoding value of the to-be-connected terminal;
[0110] S2. When the current decoding value to be accessed is greater than the current remaining decoding value, adjust the decoding value of the target terminal in the first terminal set according to the importance of each terminal in the first terminal set, to obtain the adjusted remaining decoding value of the target device, where the first terminal set includes a first terminal subset and the terminal to be accessed, and the first terminal subset includes the terminals currently accessing the target device;
[0111] S3. When the remaining decoding value of the target device is greater than or equal to the decoding value to be accessed of the terminal to be accessed, connect the terminal to be accessed to the target device.
[0112] Specific examples in this embodiment may refer to the examples described in the above embodiments and exemplary embodiments, and will not be elaborated here.
[0113] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device, so that they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a different order than here, or they can be separately made into individual integrated circuit modules, or multiple modules or steps among them can be made into a single integrated circuit module to implement. In this way, the present invention is not limited to any specific combination of hardware and software.
[0114] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An access method for a terminal, characterized in that, Including: Obtaining the current remaining decoding value of the target device and the current decoding value to be accessed of the terminal to be accessed; When the current decoding value to be accessed is greater than the current remaining decoding value, pre-adjusting the decoding values of each terminal in the first terminal set to obtain a set of released decoding values; According to the released decoding value corresponding to each terminal in the set of released decoding values and the importance of each terminal in the first terminal set, determining the target terminal in the first terminal set, and adjusting the decoding value of the target terminal according to the pre-adjustment to obtain the remaining decoding value of the adjusted target device, where the first terminal set includes a first terminal subset and the terminal to be accessed, and the first terminal subset includes the terminals currently accessing the target device; When the remaining decoding value of the target device is greater than or equal to the decoding value to be accessed of the terminal to be accessed, accessing the terminal to be accessed to the target device.
2. The method according to claim 1, wherein The determining the target terminal in the first terminal set according to the released decoding value corresponding to each terminal in the set of released decoding values and the importance of each terminal in the first terminal set includes: Determining the released decoding value that meets the preset condition in the set of released decoding values as the target released decoding value; Determining the terminal corresponding to the target released decoding value in the first terminal set as the terminal in the second terminal subset; Determining the target terminal in the second terminal subset according to the importance of each terminal in the second terminal subset.
3. The method according to claim 2, wherein The determining the released decoding value that meets the preset condition in the set of released decoding values as the target released decoding value includes: When pre-adjusting the decoding values of the terminals in the first terminal subset, determining the released decoding value that meets the first preset condition in the subset of released decoding values as the target released decoding value, where the subset of released decoding values includes the released decoding values obtained by pre-adjusting the decoding values of the terminals in the first terminal subset, and the set of released decoding values includes the subset of released decoding values.
4. The method according to claim 3, wherein The determining the decoding value that meets the first preset condition in the subset of released decoding values as the target released decoding value includes: Performing the following operations on each released decoding value in the subset of released decoding values, and when performing the following operations, each released decoding value is the current released decoding value: Determining the sum of the current released decoding value and the current remaining decoding value of the target device as the first sum value; When the first sum value is greater than or equal to the current decoding value to be accessed of the terminal to be accessed, determining the current released decoding value as the target released decoding value.
5. The method according to any one of claims 2 to 4, characterized in that The determining the target terminal in the second terminal subset according to the importance of each terminal in the second terminal subset includes: Determining the terminal with the lowest importance in the second terminal subset as the target terminal, where the importance includes one of the following: the total score of the currently opened events, the total score of the importance of the events in the current time period, the total score of the importance of the event frequency; or, Determine the importance by taking the sum of at least two of the current event total score of the enabled event, the current time period event importance total score, and the event frequency importance total score, and determine the target terminal as the terminal with the lowest importance in the second terminal subset.
6. The method according to claim 3, wherein The step of determining the target release decoding value by determining the decoding values in the release decoding value subset that meet the first preset condition further includes: Combining at least two release decoding values in the release decoding value subset to obtain multiple release decoding value combinations; Obtain the sum value of the release decoding values of each release decoding value combination to obtain multiple sum values of the release decoding values, where the sum value of the release decoding values is the sum of the release decoding values in the release decoding value combination; Determine the release decoding value in the target release decoding value combination among the multiple release decoding value combinations as the target release decoding value, where the sum of the release decoding value sum value of the target release decoding value combination and the current remaining decoding value is greater than or equal to the current decoding value to be accessed.
7. The method according to claim 6, characterized in that, The step of determining the target terminal in the second terminal subset according to the importance of each terminal in the second terminal subset includes: When at least two of the target release decoding value combinations are included in the multiple release decoding value combinations, obtain at least two terminal combinations corresponding to at least two of the target release decoding value combinations, where each target release decoding value combination corresponds to a terminal combination, and each release decoding value in the target release decoding value combination is the release decoding value obtained after pre-adjusting the decoding value of the corresponding terminal in the corresponding terminal combination; Determine the terminal combination with the lowest importance among the at least two terminal combinations as the target terminal combination, and determine the terminal in the target terminal combination as the target terminal.
8. An access device for a terminal, characterized in that It includes: An acquisition module for acquiring the current remaining decoding value of the target device and the current decoding value to be accessed of the terminal to be accessed; An adjustment module for, when the current decoding value to be accessed is greater than the current remaining decoding value, adjusting the decoding value of the target terminal in the first terminal set according to the importance of each terminal in the first terminal set to obtain the remaining decoding value of the target device after adjustment, where the first terminal set includes a first terminal subset and the terminal to be accessed, and the first terminal subset includes the terminals currently accessing the target device; An access module for, when the remaining decoding value of the target device is greater than or equal to the decoding value to be accessed of the terminal to be accessed, accessing the terminal to be accessed to the target device; The adjustment module is further configured to pre-adjust the decoding value of each terminal in the first terminal set to obtain a set of release decoding values; determine the target terminal in the first terminal set according to the release decoding value corresponding to each terminal in the set of release decoding values and the importance of each terminal in the first terminal set, and adjust the decoding value of the target terminal according to the pre-adjustment.
9. A storage medium, characterized in that, The computer program is stored in the storage medium, and when the program is run by the terminal device or the computer, it executes the method described in any one of claims 1 to 7.
10. An electronic device, comprising a memory and a processor, characterized in that, The computer program is stored in the memory, and the processor is configured to run the computer program to execute the method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Code stream adjusting method and device and computer storage medium
CN110944213A
Media node load balancing method and device, storage medium and electronic device
CN111432158A