Resource management method and device, electronic device, and storage medium
By acquiring domain users' resource usage data and session status, and setting multiple thresholds, precise resource management of graphical fortresses was achieved, solving the problem of coarse-grained resource control and improving system stability and user experience.
Patent Information
- Application Number
- CN202411551241.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2044-11-01
AI Technical Summary
In existing technologies, the resource control granularity of graphical fortresses is coarse, making it impossible to identify whether user resource needs are reasonable, resulting in the inability to perform fine-grained management and affecting system stability and performance.
By acquiring domain users' resource usage data and session status, and setting multiple resource usage thresholds and session status thresholds, precise resource management for domain users can be achieved, including closing inactive sessions and adjusting resource requests when resources are insufficient.
It enables automatic, accurate, and efficient resource management of graphical fortresses, reducing resource waste and improving system stability and user experience.
Smart Images

Figure CN119520043B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and particularly relates to a resource management method and device, electronic equipment, storage medium and computer program product. BACKGROUND
[0002] 4A platform is a common unified security management platform solution in data center, which realizes centralized and unified management of IT resources such as host, database, network device, security device and other infrastructures in data center, and realizes 4A such as account management (Account), authentication management (Authentication), authorization management (Authorization) and security audit (Audit). A common 4A architecture usually includes a front-end WEB portal, a graphical bastion, a protocol bastion, a target device group and the like.
[0003] As a security platform, the core function of the 4A platform is to prohibit direct access of terminal users to target devices, and to ensure that any access has log records and traces for auditing. The graphical bastion records the operation behavior of the user as a screen recording video by recording the screen of the user interface, and the protocol bastion analyzes the operation behavior of the user by protocol, and records key log information such as specific operation content, operation object and operation time of the user.
[0004] The graphical bastion responds to and records a large number of remote client accesses as a server during operation. When the number of user accesses is large, especially when the user unreasonably opens a large number of tools, the hardware resources of the graphical bastion will be occupied a lot, affecting the stability and performance of the system.
[0005] How to effectively manage and control the resources of the graphical bastion has become a technical problem to be solved. SUMMARY
[0006] The purpose of the embodiments of the present disclosure is to provide a resource management method and device, electronic equipment, storage medium and computer program product.
[0007] To solve the above technical problems, the embodiments of the present disclosure are realized through the following aspects.
[0008] According to a first aspect of the embodiments of the present disclosure, a resource management method is provided, which comprises: acquiring resource occupation data corresponding to a domain user and session states of at least one session; and implementing management or unmanagement of resource application of the domain user according to the resource occupation data, a preset resource occupation threshold and the session states of the at least one session.
[0009] According to a second aspect of the embodiments of the present disclosure, an apparatus for resource management and control is provided, the apparatus comprising: an acquisition module configured to acquire resource occupation data corresponding to a domain user and session states of at least one session; and a control module configured to implement control or release control on resource application of the domain user according to the resource occupation data, a preset resource occupation threshold, and the session states of the at least one session.
[0010] According to a third aspect of the embodiments of the present disclosure, an electronic device is provided, comprising: a processor; and a memory configured to store instructions executable by the processor; wherein the processor is configured to perform the steps of the method for resource management and control according to the first aspect.
[0011] According to a fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, the computer-readable storage medium storing one or more programs, the one or more programs, when executed by an electronic device comprising a plurality of application programs, causing the electronic device to perform the steps of the method for resource management and control according to the first aspect.
[0012] According to a fifth aspect of the embodiments of the present disclosure, a computer program product is provided, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, causing the computer to perform the method for resource management and control according to the first aspect.
[0013] One of the above technical solutions has the following advantages or beneficial effects: by acquiring resource occupation data corresponding to a domain user and session states, control or release control on resource application of the domain user is implemented from the granularity of the domain user, thereby realizing automatic, accurate and efficient resource management and control of the graphic bastion.
[0014] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure.
[0015] Other features and advantages of the present disclosure will be described in detail in the following specific embodiments section. BRIEF DESCRIPTION OF DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the drawings needed in the embodiments or the prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments described in the present disclosure, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.
[0017] Figure 1 An application scenario architecture schematic diagram of the resource management and control provided by the embodiments of the present disclosure is shown.
[0018] Figure 2 Fig. 1 shows a flow diagram of a method for resource management according to an embodiment of the present disclosure;
[0019] Fig. 3(a) shows a diagram of resource occupation data corresponding to a domain user according to an embodiment of the present disclosure;
[0020] Fig. 3(b) shows another diagram of resource occupation data corresponding to a domain user according to an embodiment of the present disclosure;
[0021] Figure 4 Fig. 4 shows another flow diagram of a method for resource management according to an embodiment of the present disclosure;
[0022] Figure 5 Fig. 5 shows yet another flow diagram of a method for resource management according to an embodiment of the present disclosure;
[0023] Figure 6 Fig. 6 shows still another flow diagram of a method for resource management according to an embodiment of the present disclosure;
[0024] Figure 7 Fig. 7 shows a block diagram of a device for resource management according to an embodiment of the present disclosure;
[0025] Figure 8 Fig. 8 shows a hardware structure diagram of an electronic device for implementing a method for resource management according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] In order to make the personnel in the technical field better understand the technical solutions in the present disclosure, the technical solutions in the present disclosure will be described clearly and completely in combination with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative labor should fall within the scope of protection of the present disclosure.
[0027] The resource management method in the related art is generally based on the total resource occupation data of a graphic fortress. When the total resource occupation data is greater than a first preset threshold (i.e., resource shortage), a new graphic fortress resource can be added through expansion of the graphic fortress. When it is impossible to add a new graphic fortress resource through expansion, part of the applications of part of the users are forcibly shut down to recycle resources to reduce the resource occupation data. When the total resource occupation data is less than a second preset threshold (i.e., resource sufficiency), the graphic fortress can be adjusted manually to recycle the graphic fortress.
[0028] The resource management method in the related art has the following technical problems:
[0029] Problem 1: Resource management is based on the granularity of the graphical bastion, the granularity of resource management is rough, and it is impossible to identify whether the resource demand of the user is reasonable. The related technology only focuses on whether the total resource occupation of the graphical bastion reaches the critical value, but it is impossible to determine whether there are a large number of idle sessions established by the user.
[0030] Problem 2: Resource management is based on the granularity of the graphical bastion, and it is impossible to perform fine-grained resource management, which has a greater impact on the business.
[0031] To solve the above technical problems, the present application provides a resource management method, which acquires resource occupation data and session state corresponding to the domain user, and implements management or unmanagement of resource application of the domain user from the granularity of the domain user, thereby realizing automatic, accurate and efficient resource management of the graphical bastion.
[0032] The professional terms related to the present application are introduced as follows.
[0033] Domain user: The graphical bastion in the present application is a Windows-based graphical bastion, all graphical bastions are added to the Windows domain and become part of the domain, and are managed by the domain controller. Each user establishes a domain user account, connects to the graphical bastion through a related protocol such as RDP (Remote Desktop Protocol), and logs in to the domain through the domain user account.
[0034] Session: It can also be called connection, that is, the user establishes a C / S architecture session with the graphical bastion through the client, and completes the corresponding function based on the session. Each session can correspond to a process, and the resource occupation data of the session, such as CPU occupation rate and memory occupation, can be obtained through the process identifier in the session granularity.
[0035] Figure 1 An application scenario architecture schematic diagram of the resource management provided by the embodiment of the present disclosure is shown as Figure 1As shown, the domain user can connect to the graphical bastion 2 through the client 1, the graphical bastion 2 interacts with the domain control server 3 for domain user authentication, and the domain control server 3 can be configured and / or issued with the domain control policy corresponding to the domain user, so as to control or release the control of the resource application of the domain user based on the domain control policy. The graphical bastion 2 can also terminate one or more sessions of the domain user under the control of the domain control server 3 to release the resources of the sessions. The resource control server 4 is connected with the domain control server 3, the graphical bastion 2 and the protocol bastion 5, and is used to obtain the resource occupation data of the domain user on the graphical bastion 2 through the graphical bastion 2, obtain the session state of at least one session of the domain user through the protocol bastion 5, and control or release the control of the resource application of the domain user through the domain control server 3. The domain user can access the target resource 6 such as a host resource, a database resource, a network device resource or a security device resource after passing through the graphical bastion 2 and the protocol bastion 5.
[0036] It should be noted that although the application is described by taking the bastion machine as an example, the resource control method of similar scenarios with the following characteristics is within the protection scope of the application.
[0037] Feature 1: The user (in the application, the domain user, which can also be a user corresponding to a client) and the server (in the application, the graphical bastion) are connected through the C / S architecture, and the resources of the server are requested and shared.
[0038] Feature 2: The same user can establish a session with multiple servers, and the same server can establish a session with multiple users. One user can establish one or more sessions on one server.
[0039] Figure 2 A flowchart of a method for resource control provided by an embodiment of the disclosure is shown. The method can be executed by a resource control server, which can be an independent server or a server cluster other than the graphical bastion, or can be arranged on a server corresponding to the 4A platform, such as Figure 2 As shown, the method can include the following steps:
[0040] In step S101, resource occupation data corresponding to a domain user and session state of at least one session are obtained.
[0041] In some embodiments, the resource occupation data corresponding to the domain user can include user-level statistical values of the resource occupation data corresponding to each domain user, and can also include resource occupation data corresponding to at least one session corresponding to each domain user respectively.
[0042] In some possible implementations, the resource occupation data corresponding to the domain user can be obtained through an acquisition script deployed in the graphical bastion, the acquisition script can be developed based on Get-Process (obtaining running processes on a local computer) of Windows PowerShell, so as to perform performance monitoring on the graphical bastion, and the resource occupation data can be obtained periodically based on a preset sampling period, preferably, the sampling period can be set to 5 minutes, and can also be adjusted flexibly in response to user adjustment operations.
[0043] The resource occupation data can be dimensional absolute resource occupation data, for example, memory occupation is 1M, or can be dimensionless relative resource occupation data, for example, CPU occupation rate is 1%. Of course, the resource occupation data can also be a combination of the two, which is not limited in the present application.
[0044] FIGS. 3(a) and 3(b) respectively show a schematic diagram of resource occupation data corresponding to a domain user provided by an embodiment of the present disclosure, as shown in FIG. 3(a), the resource occupation data can include resource occupation data corresponding to at least one session corresponding to each domain user respectively. As shown in FIG. 3(b), the resource occupation data corresponding to the domain user can include user-level statistical values of the resource occupation data corresponding to each domain user. In some possible implementations, the user-level statistical values of the resource occupation data corresponding to each domain user shown in FIG. 3(b) can be obtained through cumulative summary based on the resource occupation data corresponding to at least one session corresponding to each domain user shown in FIG. 3(a).
[0045] The session state of the session can include a service state of the session, the service state including an active state or an inactive state, indicating whether the current session has interacted with service data within a preset connection idle duration, in the case that the current session has interacted with service data within the preset connection idle duration, the service state of the session is the active state, and in the case that the current session has not interacted with service data within the preset connection idle duration, the service state of the session is the inactive state.
[0046] After obtaining the service state of at least one session corresponding to each domain user, the proportion of active sessions can be calculated according to the service state of the at least one session, i.e., the proportion of sessions in which each domain user is in an inactive state on a certain graphical bastion, and the proportion of active sessions is taken as the session state of the domain user.
[0047] In some possible implementations, the network connection information corresponding to the PID process identifier can be obtained by executing "netstat -no | find PID" (where PID is a process identifier) in the graphical bastion. The network connection information can specifically include a source IP address, a destination IP address, a source port number, and a destination port number. In a case where the network connection information fails to be obtained (i.e., no network connection information is obtained), it can be determined that the service state of the session is an inactive state. After the network connection information is successfully obtained, it can be further determined whether the session has interacted with service data within a preset connection idle time length. In a case where the session has not interacted with service data within the connection idle time length, it can also be determined that the service state of the session is an inactive state. Otherwise, it can be determined that the service state of the session is an active state. In a specific implementation, the 4A platform can obtain, through the protocol bastion, whether the session has interacted with service data within the preset connection idle time length. Preferably, the connection idle time length can be 10 minutes, and can also be flexibly adjusted in response to a user adjustment operation.
[0048] In step S102, the resource application of the domain user is controlled or released from control according to the resource occupation data, the preset resource occupation threshold, and the session state of the at least one session.
[0049] In some embodiments, the resource application of the domain user whose resource occupation data is greater than or equal to the preset resource occupation threshold can be controlled, and the resource application of the domain user whose resource occupation data is greater than or equal to the preset resource occupation threshold and whose proportion of active sessions is less than a preset proportion of active sessions threshold can also be controlled. The resource application of the domain user whose resource occupation data is less than the preset resource occupation threshold and who is in a resource application control state can be released from control.
[0050] In some possible implementations, the resource application of the domain user can be controlled or released from control through interaction with the domain control server. Specifically, the following steps can be included.
[0051] Step 11, a corresponding domain control policy is pre-set on the domain control server to set an application program that is not allowed to be opened by the domain user.
[0052] Step 12, the domain control server can bind the domain user and the domain control policy in response to a message of the resource control server, so as to control the resource application of the domain user.
[0053] For example, the domain control server can bind the domain user to the domain control policy by using the following command: Set-GPPermissions -Guid '6a24f435-4148-4364-b139-9a148710cf0b' -TargetName 'd16\zhangsan' -TargetType User -PermissionLevel 'GpoApply', and bind the domain user 'zhangsan' to the domain control policy 'GpoApply' which is effective in the scope of the dc16 domain. After the domain user is bound to the domain control policy, the effect can be activated by using the command Invoke-GPUpdate. Thus, the domain user is denied to establish a new session, and the existing session cannot open a new application.
[0054] In step 13, the domain control server can unbind the domain user from the domain control policy in response to the message of the resource control server, and implement uncontrolled resource application of the domain user.
[0055] For example, the domain control server can unbind the domain user from the domain control policy by using the following command: Set-GPPermissions -Guid '6a24f435-4148-4364-b139-9a148710cf0b' -TargetName 'd16\zhangsan' -TargetType User -PermissionLevel 'None'. After the domain user is unbound from the domain control policy, the effect can be activated by using the command Invoke-GPUpdate. Thus, the control of the domain user to establish a new session is released, and the existing session can normally open a new application.
[0056] By using the above technical solution, the resource application of the domain user is controlled or uncontrolled from the granularity of the domain user by obtaining the resource occupation data corresponding to the domain user and the session state of the at least one session, so that automatic, accurate and efficient resource control of the graphical fortress is realized.
[0057] Considering that the resource occupation data corresponding to the domain user and the session state of the at least one session obtained in different sampling periods are constantly changing, in some embodiments, a plurality of resource occupation thresholds can be set to avoid frequent fluctuations of the control state of the domain user between the implementation of control and the release of control.
[0058] In some embodiments, the resource occupation threshold includes a first resource occupation threshold, a second resource occupation threshold and a third resource occupation threshold, wherein the second resource occupation threshold is greater than the first resource occupation threshold, and the third resource occupation threshold is greater than the second resource occupation threshold.
[0059] Taking the memory occupation absolute resource occupation data as an example, the second resource occupation threshold can be set as 1G of memory occupation, the first resource occupation threshold can be set as 800M, and the third resource occupation threshold can be set as 1.2G. That is, the second resource occupation threshold is taken as the resource occupation standard threshold, and the first resource occupation threshold and the third resource occupation threshold are taken as the resource occupation lower limit threshold and the resource occupation upper limit threshold respectively, so that the control state of the domain user can be prevented from frequently fluctuating between the implementation of control and the release of control through the resource occupation standard threshold, the resource occupation lower limit threshold and the resource occupation upper limit threshold.
[0060] Figure 4 Another flowchart for illustrating the method of resource control provided by the embodiments of the present disclosure is shown in FIG. 6. As shown in FIG. 6, step S102 can specifically include the following steps. Figure 4
[0061] In step 100, it is compared whether the resource occupation data is greater than or equal to the second resource occupation threshold.
[0062] In step 101, in the case that the resource occupation data is less than the second resource occupation threshold, it is compared whether the resource occupation data is less than the first resource occupation threshold.
[0063] In step 102, in the case that the resource occupation data is less than the first resource occupation threshold, the resource application of the domain user is released from control.
[0064] In some embodiments, in the case that the resource occupation data is less than the first resource occupation threshold and the control state of the resource application of the domain user is the implementation of control, the resource application of the domain user can be released from control. In the case that the resource occupation data is less than the first resource occupation threshold and the control state of the domain user is not the implementation of control, the current sampling period can be ignored, and a counter for the number of continuous periods satisfying whether the resource occupation data is greater than or equal to the second resource occupation threshold can be reset.
[0065] In step 103, in the case that the resource occupation data is greater than or equal to the second resource occupation threshold, it is judged whether the number of continuous periods satisfying the condition is greater than a preset number threshold.
[0066] Preferably, the preset number threshold can be 3, or can be flexibly set according to needs.
[0067] In step 104, in the case that the resource occupation data is greater than or equal to the second resource occupation threshold and the number of continuous periods satisfying that the resource occupation data is greater than or equal to the second resource occupation threshold is greater than the preset number threshold, the resource application of the domain user can be controlled according to the resource occupation data, the third resource occupation threshold and the session state of at least one session.
[0068] Specifically, when controlling the resource application of the domain user according to the resource occupation data, the third resource occupation threshold and the session state of the at least one session, it can be first judged whether the active session proportion is less than a preset active session proportion threshold, and the resource application of the domain user is controlled in the case that the active session proportion is less than the preset active session proportion threshold.
[0069] Preferably, the active session proportion threshold can be 90%, or can be flexibly set according to needs.
[0070] And in the case that the resource occupation data is greater than or equal to the second resource occupation threshold, and the number of continuous periods in which the resource occupation data is greater than or equal to the second resource occupation threshold is less than or equal to the preset number threshold, the judgment of the next sampling period can be continued.
[0071] In step 105, in the case that the active session proportion is greater than or equal to the active session proportion threshold, it is further judged whether the resource occupation data is greater than the third resource occupation threshold.
[0072] In step 106, in the case that the active session proportion is greater than or equal to the preset active session proportion threshold, and the resource occupation data is greater than the third resource occupation threshold, the resource application of the domain user is controlled.
[0073] In the case that the active session proportion is greater than or equal to the preset active session proportion threshold, and the resource occupation data is less than or equal to the third resource occupation threshold, the current sampling period can be ignored.
[0074] By using the above technical solution, the resource application of the domain user can be controlled or released from the granularity of the domain user, and through the setting of multiple resource occupation thresholds, the control state of the domain user between the implementation of control and the release of control can be avoided from frequent fluctuation, and the stability of resource control is further improved.
[0075] Figure 5 Another flowchart of the method of resource control provided by the embodiments of the present disclosure is shown, as shown in Figure 5 The method can further include the following steps.
[0076] In step S103, the resource occupation data is saved as resource occupation baseline data.
[0077] In some embodiments, the resource occupation data collected by all the graphic bastions can be saved as resource occupation baseline data, so that the administrator can set or modify the preset parameters based on the corresponding resource occupation baseline data of all the graphic bastions. For example, the administrator can set or modify one or more of the resource occupation threshold, the active session ratio threshold, the connection idle duration, and the sampling period based on the resource occupation baseline data.
[0078] By saving the resource occupation data as resource occupation baseline data, the above technical solution provides a basis for the administrator to set or modify the preset parameters, and further improves the accuracy of resource management and control.
[0079] In some embodiments, the domain users can be of the same or different types, and the resource occupation threshold corresponding to different types of domain users is different.
[0080] For example, based on the different roles of users, the domain users can be divided into light users (such as host administrators and network administrators), mixed users (ordinary operation users), and heavy users (developers and database administrators). The actual occupation of hardware resources of the graphic bastion by different users is significantly different.
[0081] Taking a Windows-based graphic bastion as an example, since the CPU occupation of each application client is very small (generally less than 1%), the main hardware resource of the graphic bastion occupied by the domain user is memory. Different resource occupation thresholds can be set for different types of domain users through Table 1 as follows.
[0082] Table 1
[0083]
[0084] By setting different resource occupation thresholds for different types of domain users, the above technical solution can achieve more accurate implementation of management and control or release of control on the domain users, and further improves the accuracy of resource management and control.
[0085] It should be noted that when the resource application of the domain user is managed or released based on the resource occupation data, the preset resource occupation threshold, and the session state of the at least one session, one or more resource occupation data and the corresponding resource occupation threshold can be used for judgment.
[0086] In some embodiments, when judging according to the plurality of resource occupation data and the respectively corresponding resource occupation threshold, the plurality of resource occupation data can be converted into a representation form of the same resource occupation data, and then the weighted resource occupation data of the plurality of resource occupation data is calculated through a preset weight, and compared with the comprehensive resource occupation threshold for judgment. For example, the plurality of resource occupation data are CPU occupation rate (dimensionless relative value) and memory occupation absolute value (dimensioned absolute value), the actual memory occupation absolute value and the second resource occupation threshold corresponding to the memory occupation absolute value can be taken as the memory occupation rate, and then the weighted resource occupation data is calculated according to the weighted average value of the CPU occupation rate and the memory occupation rate, and compared with the corresponding weighted resource occupation threshold, so as to implement control or release control on the resource application of the domain user.
[0087] In the related art, in the case that the resource is insufficient and the graphic fortress cannot be expanded urgently, the operation and maintenance personnel usually manually collect the resource occupation information of the graphic fortress, determine the target graphic fortress to be processed and the target domain user to be released, recycle the resource by suspending one or more sessions of the target domain user, or even for the graphic fortress with serious resource shortage, release the resource occupation by forcibly restarting. The above-mentioned manual resource recycling method is blind and inefficient, and the measures of suspending the session or forcibly restarting are relatively arbitrary, which seriously affects the user's perception.
[0088] To solve the above technical problems, Figure 6 Another flowchart of the method for resource control provided by the embodiment of the present disclosure is shown. Figure 6 As shown, the method can further include the following steps.
[0089] In step S104, in the case that the total resource occupation data of the plurality of domain users is greater than the preset fourth resource occupation threshold, the target domain user to be released is determined from the plurality of domain users.
[0090] It can be understood that in the case that the total resource occupation data of the plurality of domain users is greater than the preset fourth resource occupation threshold, if the graphic fortress can be expanded, the graphic fortress can be expanded preferentially, and the overall resource occupation can be reduced through the expanded graphic fortress. In the case that the graphic fortress cannot be expanded, the method shown in the embodiment is used to recycle the resource.
[0091] In some embodiments, the target domain user can be any one of the following:
[0092] The domain user with the highest resource occupation proportion;
[0093] The domain user with the smallest active session proportion in the plurality of domain users with the same highest resource occupation proportion.
[0094] In some embodiments, the user-level statistical value of the resource occupation data corresponding to each domain user shown in Fig. 3(b) can be used as the total resource occupation data of the domain user.
[0095] When the total resource occupation data is greater than a preset fourth resource occupation threshold, the domain user with the highest resource occupation ratio can be selected as the target domain user. When there are multiple domain users with the highest resource occupation ratio, the domain user with the smallest active session ratio among the multiple domain users with the same highest resource occupation ratio can be selected as the target domain user.
[0096] In other embodiments, the target domain user can also be the multiple domain users with the highest resource occupation ratio.
[0097] In step S105, the target session to be released is determined from the multiple sessions corresponding to the target domain user, and the target session is terminated to release the resources of the target session.
[0098] In some embodiments, the target session is one or more sessions with the highest resource occupation ratio among the sessions with the non-active state of the service state.
[0099] In some possible implementations, the domain control server can terminate the target session to release the resources of the target session. Specifically, the domain control server can terminate the target session by issuing the following command.
[0100] “Invoke-Command -ComputerName Graph Bastion Machine Name -ScriptBlock {Stop-Process -Id Process Identifier of the Target Session -Force}”.
[0101] With the above technical solutions, the target session of the target domain user can be closed according to the resource occupation data, the resource occupation threshold, and the active situation of the session of the user, so as to realize automatic, accurate and efficient resource recycling, and the closed target session is the session with the non-active state of the service state, which can also reduce or avoid affecting the user experience of the target domain user.
[0102] Figure 7 A block diagram of a resource management and control device provided by an embodiment of the present application is shown, as shown in Figure 7 The resource management and control device 200 includes:
[0103] The acquisition module 210 is configured to acquire resource occupation data corresponding to a domain user and a session state of at least one session.
[0104] The control module 220 is configured to control or release the control on the resource application of the domain user according to the resource occupation data, the preset resource occupation threshold, and the session state of the at least one session.
[0105] Optionally, the resource occupation threshold includes a first resource occupation threshold, a second resource occupation threshold, and a third resource occupation threshold, the second resource occupation threshold is greater than the first resource occupation threshold, and the third resource occupation threshold is greater than the second resource occupation threshold, and the control module 220 is further configured to release the control on the resource application of the domain user in a case where the resource occupation data is less than the first resource occupation threshold; or,
[0106] In a case where the resource occupation data is greater than or equal to the second resource occupation threshold and a continuous number of times that the resource occupation data is greater than or equal to the second resource occupation threshold is greater than a preset number threshold, the control module 220 is further configured to control the resource application of the domain user according to the resource occupation data, the third resource occupation threshold, and the session state of the at least one session.
[0107] Optionally, the session state includes an active session proportion, and the control module 220 is further configured to control the resource application of the domain user in a case where the active session proportion is less than a preset active session proportion threshold; or,
[0108] In a case where the active session proportion is greater than or equal to the preset active session proportion threshold and the resource occupation data is greater than the third resource occupation threshold, the control module 220 is further configured to control the resource application of the domain user.
[0109] Optionally, the control module 220 is further configured to save the resource occupation data as resource occupation baseline data.
[0110] Optionally, the control module 220 is further configured to determine a target domain user to which resources are to be released from a plurality of domain users in a case where total resource occupation data of the plurality of domain users is greater than a preset fourth resource occupation threshold.
[0111] The control module 220 is further configured to determine a target session to which resources are to be released from a plurality of sessions corresponding to the target domain user, and to terminate the target session to release resources of the target session.
[0112] Optionally, the target session is a session with the highest resource occupation proportion among sessions with a non-active state.
[0113] The target domain user is any one of the following:
[0114] A domain user with the highest resource occupation proportion;
[0115] A domain user with the smallest active session proportion among a plurality of domain users with the same highest resource occupation proportion.
[0116] The device 200 provided by the embodiments of the present application can execute the methods in the foregoing method embodiments, and achieve the functions and advantages of the methods in the foregoing method embodiments, which will not be repeated here.
[0117] Figure 7 A hardware structure schematic diagram of an electronic device performing the embodiments of the present disclosure is shown as follows, Figure 7 At the hardware level, the electronic device includes at least one processor, and optionally includes an internal bus, a network interface, and a memory. The memory can include an internal memory, such as a high-speed random access memory (RAM), and can also include a non-volatile memory, such as at least one disk memory. Of course, the electronic device can also include other hardware required by the business.
[0118] The processor, the network interface, and the memory can be connected to each other through the internal bus, which can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one bidirectional arrow is used in the figure, but it does not mean that there is only one bus or only one type of bus.
[0119] The memory stores programs. Specifically, the programs can include program codes including at least one computer operation instruction. The memory can include an internal memory and a non-volatile memory, and provide instructions and data to the processor.
[0120] The at least one processor reads the corresponding computer program from the non-volatile memory into the memory and then runs, and forms the device for positioning a target user at the logical level. The at least one processor executes the programs stored in the memory, and specifically executes the method disclosed in the embodiments of the first aspect and achieves the functions and advantages of the methods described in the foregoing method embodiments, which will not be repeated here.
[0121] The method disclosed in the embodiment of the first aspect of the present disclosure can be applied to at least one processor or implemented by at least one processor. The processor can be an integrated circuit chip with a processing capability of signals. In the implementation process, each step of the above method can be completed by integrated logic circuits of hardware in the at least one processor or instructions in the form of software. The processor mentioned above can be a general processor, including a central processing unit (CPU), a network processor (NP), etc.; can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. Each method, step and logic block diagram disclosed in the embodiment of the present disclosure can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the embodiment of the present disclosure can be directly embodied as a hardware code processor for execution, or a combination of hardware and software modules in the code processor for execution. The software module can be located in a random memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register or other mature storage medium in the art. The storage medium is located in the memory, and the processor reads the information in the memory and combines the hardware to complete the steps of the above method.
[0122] The electronic device can also perform the methods described in the foregoing method embodiments and achieve the functions and beneficial effects of the methods described in the foregoing method embodiments, which will not be repeated here.
[0123] Of course, in addition to the software implementation, the electronic device of the present disclosure does not exclude other implementation manners, such as logic devices or a combination of software and hardware, etc. That is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or a logic device.
[0124] The embodiment of the present disclosure further proposes a computer readable storage medium, the computer readable medium stores one or more programs, when the one or more programs are executed by at least one processor, the method disclosed in the embodiment of the first aspect is implemented and the functions and beneficial effects of the methods described in the foregoing method embodiments are achieved, which will not be repeated here.
[0125] The computer readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disc or an optical disc, etc.
[0126] Further, the embodiments of the present disclosure also provide a computer program product, which comprises a computer program stored in a non-transitory computer readable storage medium. The computer program comprises program instructions, and when the program instructions are executed by a computer, the computer is caused to perform the method disclosed in the embodiments of the first aspect and realize the functions and beneficial effects of the methods disclosed in the foregoing method embodiments, which will not be repeated here.
[0127] Embodiments of the present application provide a computer program product, which comprises a computer program. When the computer program is executed by a processor, each process of the method disclosed in the embodiments of the first aspect is realized, and the same technical effects can be achieved. To avoid repetition, details will not be repeated here.
[0128] In summary, the above only describes the preferred embodiments of the present disclosure, and does not limit the protection scope of the present disclosure. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
[0129] The system, module or unit described in the above embodiments can be specifically implemented by a computer chip or entity, or by a product with certain functions. A typical implementation device is a computer. Specifically, the computer may, for example, be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0130] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can store information accessible by a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.
[0131] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusions, so that a process, method, article or apparatus that includes a list of elements does not only include those elements, but also includes other elements not explicitly listed, or inherent to such a process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.
[0132] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, for system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.
Claims
1. A method for resource management, characterized in that, The method includes: Obtain resource usage data corresponding to domain users and the session status of at least one session, wherein the session status includes the proportion of active sessions; When the resource usage data is greater than or equal to the second resource usage threshold, and the number of consecutive periods in which the resource usage data is greater than or equal to the second resource usage threshold is greater than a preset quantity threshold, the resource requests of the domain user are controlled based on the resource usage data, the third resource usage threshold, and the session status of the at least one session. Wherein, the third resource occupancy threshold is greater than the second resource occupancy threshold; The step of controlling the resource requests of the domain user based on the resource usage data, the third resource usage threshold, and the session state of at least one session includes: If the active session ratio is less than a preset active session ratio threshold, resource requests from the domain users will be controlled; or, If the active session ratio is greater than or equal to a preset active session ratio threshold, and the resource usage data is greater than the third resource usage threshold, resource requests from domain users will be controlled.
2. The method according to claim 1, characterized in that, The method further includes: If the resource usage data is less than the first resource usage threshold, the resource request of the domain user will be released from control. Wherein, the second resource occupancy threshold is greater than the first resource occupancy threshold.
3. The method according to claim 1, characterized in that, The method further includes: The resource usage data is saved as resource usage baseline data.
4. The method according to claim 1, characterized in that, The domain users can be the same or different types of users, and the resource consumption thresholds for different types of domain users are different.
5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: If the total resource usage of multiple domain users exceeds a preset fourth resource usage threshold, the target domain user whose resources are to be released is determined from the multiple domain users. The target session whose resources are to be released is determined from multiple sessions corresponding to the target domain user, and the target session is terminated to release the resources of the target session.
6. The method according to claim 5, characterized in that, The target session is the session with the highest resource consumption ratio among sessions whose business status is inactive; the target domain user is any one of the following: The domain user with the highest resource consumption ratio; Among multiple domain users with the same and highest resource usage ratio, the domain user with the lowest active session ratio is selected.
7. A resource management device, characterized in that, The device includes: The acquisition module is used to acquire resource usage data corresponding to domain users and the session status of at least one session, wherein the session status includes the active session ratio; The control module is used to control the resource requests of the domain user based on the resource usage data, the third resource usage threshold, and the session status of the at least one session when the resource usage data is greater than or equal to the second resource usage threshold and the number of consecutive periods in which the resource usage data is greater than or equal to the second resource usage threshold is greater than a preset quantity threshold. Wherein, the third resource occupancy threshold is greater than the second resource occupancy threshold; The step of controlling the resource requests of the domain user based on the resource usage data, the third resource usage threshold, and the session state of at least one session includes: If the active session ratio is less than a preset active session ratio threshold, resource requests from the domain users will be controlled; or, If the active session ratio is greater than or equal to a preset active session ratio threshold, and the resource usage data is greater than the third resource usage threshold, resource requests from domain users will be controlled.
8. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the resource management method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the resource management method as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, The computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions that, when executed by a computer, cause the computer to perform the resource management method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Session resource management method and apparatus
CN106230649A
Method and device for controlling number of online consulting users
CN110661823A