Resource occupation method and device for power system
By identifying the accounts and target resources that need to occupy resources in the power system, determining whether the resources are exhausted, and comparing the account priority, the problem of resource occupation in the existing technology that users cannot allocate resources is solved, and the reasonable allocation of resources is achieved and Improvement of user experience.
Patent Information
- Application Number
- CN202310944492.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-28
- Publication Date
- 2025-02-14
AI Technical Summary
The resource occupation method of smart electronic devices in the existing power system causes the later users to be unable to allocate resources, affecting the user experience.
By identifying the accounts and target resources that need to occupy resources, determine whether the resources are exhausted, and determine the account with the lowest priority (worst account) of the current resource occupancy, and then compare the priority of the target account with the priority of the worst account, and decide on Whether to seize resources.
Reasonable allocation of resources is achieved to ensure that important users who arrive later can obtain resources and improve user experience.
Smart Images

Figure CN119443535A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electric power systems, and in particular to a resource occupation method and device for electric power systems. Background Art
[0002] Intelligent Electronic Devices (IEDs) in power systems usually have limited resources.
[0003] In the prior art, when different users occupy resources, the principle of first come first served is generally adopted. When a certain resource is fully occupied, it is impossible to allocate resources to users who arrive later. This method will result in the inability to allocate resources to some important users who arrive later, affecting the user experience. Summary of the invention
[0004] In view of this, the present invention proposes a resource occupation method for a power system, wherein a power system includes multiple resources, an account can log in to the power system and occupy at least one resource, each account corresponds to at least one role, and the resource occupation method includes:
[0005] If it is identified that a first account needs to occupy a first target resource of the power system, it is determined whether the first target resource has been currently used up, and the first account has a role with permission to occupy the first target resource;
[0006] If the judgment result is yes, then determining a first worst account among the accounts currently occupying the first target resource, the first worst account being an account with the lowest priority corresponding to the first target resource among the accounts, the priority of each account being determined according to a target role with the highest priority for the first target resource among the target roles corresponding to the account, the target role being a role having authority for the first target resource;
[0007] determining whether the priority of the first account corresponding to the first target resource is higher than that of the first worst account;
[0008] If the judgment result is yes, it is determined that the first account can occupy the first target resource corresponding to the first worst account.
[0009] According to the method as described above, optionally, after identifying that a first account needs to occupy a first target resource of the power system and before determining a first worst account among multiple accounts currently occupying the first target resource, the method further includes:
[0010] Determining whether the first target resource supports replacing the current account;
[0011] If the judgment result is yes, an operation of determining a first worst account among multiple accounts currently occupying the first target resource is performed.
[0012] According to the method as described above, optionally, the first target resource corresponds to at least one basic operation for a target object, and the power system further includes a second target resource, and the second target resource corresponds to at least one advanced operation for the target object.
[0013] After the first account occupies the first target resource corresponding to the first worst account, the method further includes:
[0014] identifying whether the first account needs to perform a target operation, where the target operation is one of the advanced operations;
[0015] If the identification result is yes, determining whether the second target resource is exhausted;
[0016] If the judgment result is yes, determining a second worst account among the accounts currently occupying the second target resource, where the second worst account is an account with the lowest priority for the target operation among the accounts currently occupying the second target resource;
[0017] Determining whether the priority of the first account for the target operation is higher than that of the second worst account;
[0018] If the judgment result is yes, it is determined that the first account can preempt the second target resource of the second worst account.
[0019] According to the method described above, optionally, the priority information of each target role is stored in the role information of a local or remote RBAC server.
[0020] According to the method described above, optionally, when the priorities of the target roles are the same, the priority of the account is determined based on at least one of the following factors:
[0021] The priority of the account logged in locally is higher than the priority of the account logged in remotely;
[0022] The priority of an account that occupies the first target resource for a short time is higher than the priority of an account that occupies the first target resource for a long time;
[0023] Accounts with a shorter inactivity time have a higher priority than accounts with a longer inactivity time.
[0024] The present invention provides a resource occupying device for an electric power system. An electric power system includes multiple resources. An account can log in to the electric power system and occupy at least one resource. Each account corresponds to at least one role. The resource occupying device includes:
[0025] a first identification unit, used to identify whether a first account needs to occupy a first target resource of the power system, and whether the first account has a role with permission to occupy the first target resource, and if the identification result is yes, triggering a first judgment unit;
[0026] The first judging unit is used to judge whether the first target resource is currently exhausted, and if the judgment result is yes, trigger a first determining unit;
[0027] The first determining unit is used to determine a first worst account among the accounts currently occupying the first target resource, the first worst account being an account with the lowest priority corresponding to the first target resource among the accounts, the priority of each account being determined according to a target role with the highest priority for the first target resource among the target roles corresponding to the account, the target role being a role having authority for the first target resource;
[0028] a second judging unit, configured to judge whether the priority of the first account corresponding to the first target resource is higher than that of the first worst account, and if the judgment result is yes, triggering a second determining unit;
[0029] The second determining unit is configured to determine whether the first account can occupy the first target resource corresponding to the first worst account.
[0030] According to the above device, optionally, it further comprises a pre-judgment unit, wherein the pre-judgment unit is used to:
[0031] Determining whether the first target resource supports replacing the current account;
[0032] If the judgment result is yes, the first determining unit is triggered.
[0033] According to the device as described above, optionally, the first target resource corresponds to at least one basic operation for a target object, the power system further includes a second target resource, the second target resource corresponds to at least one advanced operation for the target object, and the device further includes:
[0034] a second identification unit, configured to identify whether the first account needs to perform a target operation, wherein the target operation is one of the advanced operations, and if the identification result is yes, triggering a third judgment unit;
[0035] The third judging unit is used to judge whether the second target resource is exhausted, and if the judgment result is yes, trigger a third determining unit;
[0036] The third determining unit is used to determine a second worst account among the accounts currently occupying the second target resource, where the second worst account is an account with the lowest priority for the target operation among the accounts currently occupying the second target resource;
[0037] a fourth judging unit, configured to judge whether the priority of the first account for the target operation is higher than that of the second worst account, and if the judgment result is yes, trigger a fourth determining unit;
[0038] The fourth determining unit is configured to determine whether the first account can preempt the second target resource of the second worst account.
[0039] According to the device as described above, optionally, the priority information of each target role is stored in the role information of a local or remote RBAC server; and / or
[0040] When the priority of the target roles is the same, the priority of the account is determined based on at least one of the following factors:
[0041] The priority of the account logged in locally is higher than the priority of the account logged in remotely;
[0042] The priority of an account that occupies the first target resource for a short time is higher than the priority of an account that occupies the first target resource for a long time;
[0043] Accounts with a shorter inactivity time have a higher priority than accounts with a longer inactivity time.
[0044] The present invention also provides a resource occupying device for an electric power system, comprising:
[0045] at least one memory for storing instructions;
[0046] At least one processor is configured to execute the resource occupying device for a power system according to any one of the above items according to the instructions stored in the memory.
[0047] The present invention further provides a readable storage medium, wherein the readable storage medium stores machine-readable instructions. When the machine-readable instructions are executed by a machine, the machine executes the resource occupying device for a power system as described in any one of the above items.
[0048] It can be seen from the above scheme that by setting a priority for a certain resource for each role, the priority of the account is determined by the priority of the role, and then by comparing the priority of the first account that currently wants to occupy the first target resource with the priority of the first worst account that currently occupies the first target resource, it is determined whether the first account can seize the first target resource. The implementation is relatively simple and has strong applicability. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings so that the above and other features and advantages of the present invention will be more apparent to those skilled in the art. In the accompanying drawings:
[0050] Figure 1 FIG. 4 is a flow chart of a resource occupation method for a power system according to an embodiment of the present invention.
[0051] Figure 2 FIG. 4 is a flow chart of a resource occupation method for a power system according to another embodiment of the present invention.
[0052] Figure 3 FIG. 4 is a flow chart of a resource occupation method for a power system according to another embodiment of the present invention.
[0053] Figure 4 FIG. 4 is a flow chart of a resource occupation method for a power system according to another embodiment of the present invention.
[0054] Figure 5 FIG. 4 is a schematic diagram of a resource occupying device for a power system according to an embodiment of the present invention.
[0055] Figure 6 FIG. 4 is a schematic diagram of a structure of a resource occupying device for a power system according to another embodiment of the present invention.
[0056] Figure 7 FIG. 4 is a schematic diagram of the structure of a resource occupying device for a power system according to another embodiment of the present invention. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solution and advantages of the present invention more clear, the present invention is further described in detail with reference to the following embodiments. Nouns and pronouns related to people in this patent application are not limited to specific genders.
[0058] Role-Based Access Control (RBAC) is a security approach that uses roles to define what users are allowed and not allowed to do. In an RBAC system, users are assigned roles with different permissions for different resources (such as files, databases, and applications). A user can correspond to one or more roles. Therefore, when a user tries to access a resource, the RBAC system will first look up the roles associated with the user, and then check if any role has the appropriate permissions. If so, the user is allowed to access the resource. If not, the user is denied access to the resource.
[0059] Based on the RBAC, the present invention proposes a resource occupation method for a power system.
[0060] Embodiment 1
[0061] This embodiment provides a resource occupation method for an electric power system, the electric power system includes multiple resources, such as resources for accessing logs, resources for configuring the electric power system, and resources for accessing a database. The specific application and division of the resources belong to the prior art and will not be repeated here. The execution subject of the resource occupation method of this embodiment is a resource occupation device for an electric power system, and the resource occupation device can be any device that supports RBAC, such as a relay protection device.
[0062] like Figure 1 As shown, a resource occupation method for a power system according to this embodiment is shown. The resource occupation method includes:
[0063] Step 101 , if it is identified that a first account needs to occupy a first target resource of the power system, it is determined whether the first target resource is currently exhausted. If the determination result is yes, step 102 is triggered.
[0064] The first account may correspond to one or more roles, wherein at least one role has the authority to occupy the first target resource, and the role may be an administrator, a developer, an observer, or the like.
[0065] Whether the first target resource is currently exhausted indicates whether the first target resource can be allocated to the first account without kicking out the account currently occupying its resources, that is, whether there is any remaining first target resource. If not, it means that the first target resource has been exhausted. Otherwise, the first target resource can be automatically allocated to the first account, so that resource preemption will not occur.
[0066] Step 102, determine a first worst account among multiple accounts currently occupying the first target resource, the first worst account is an account with the lowest priority corresponding to the first target resource among all accounts, the priority of each account is determined according to a target role with the highest priority for the first target resource among all target roles corresponding to the account, and the target role is a role with authority for the first target resource.
[0067] The priority for a certain resource can be set in advance for each role, and the relevant information of the priority can be pre-stored in the role information of the local or remote device, for example, the priority information is stored in the resource occupying device (locally), for example, a priority information is added to the role definition stored locally, or the priority information is stored in the RBAC device, such as the remote RBAC authentication server. Specifically, a field describing the priority information can be defined in the AOR (AoR, Area of responsibility) of the AccessToken of the remote RBAC authentication server. The priority information can also be stored as a list for easy search, and of course it can also be stored in other ways, which will not be repeated here.
[0068] As an example, if the account corresponds to one target role, the priority of the target role corresponding to the first target resource is the priority of the account for the first target resource. If the account corresponds to multiple target roles, the priority of the target role with the highest priority corresponding to the first target resource among the multiple target roles is the priority of the account for the first target resource. In addition, when the priorities of the target roles of the two accounts are the same, the priority of the account logged in locally is higher than the priority of the account logged in remotely. For example, the priority can be set for each role in advance, such as the priority of the administrator is higher than the priority of the developer, and the priority of the developer is higher than the priority of the observer. If the priorities of both accounts correspond to the priority of the administrator, the priority of the account logged in locally is higher than the priority of the account logged in remotely. Of course, it can also be that the priority of the account that occupies the first target resource for a short time is higher than the priority of the account that occupies the first target resource for a long time, so that the time the account occupies the first target resource can be controlled. It can also be that the priority of the account with a short inactive time is higher than the priority of the account with a long inactive time. The time when the user does not perform any operation can be regarded as the inactive time. If the user has not operated for a long time and still occupies the first target resource, the priority can be determined according to the inactive time. In the case where the priorities of roles are the same, other factors can be used to further determine the priority of accounts, which can further optimize resource usage. The above determination factors can be set in order according to actual needs, and will not be repeated here.
[0069] As an exemplary illustration, the first target resource can be occupied by multiple accounts at the same time. For example, the first target resource can be occupied by up to 10 accounts at the same time. Then, the account with the lowest priority corresponding to the first target resource among these 10 accounts is the first worst account. It should be noted that the first worst account refers to the account with the lowest priority for the first target resource. For other resources, the priorities need to be re-sorted.
[0070] When making a specific comparison, one of the accounts can be selected and compared with the priorities of other accounts in turn. If there are accounts with the same priority, one of them can be randomly selected, or a user with a long login time or inactive user can be selected to select the first worst account.
[0071] Step 103 , determining whether the priority of the first account corresponding to the first target resource is higher than the first worst account. If the determination result is yes, step 104 is triggered.
[0072] Step 104: Determine whether the first account can occupy the first target resource corresponding to the first worst account.
[0073] If the priority of the first account corresponding to the first target resource is higher than the first worst account, it is determined that the first account can occupy the first target resource corresponding to the first worst account, that is, the first worst account will be kicked out. If the priority of the first account corresponding to the first target resource is less than or equal to the first worst account, it is determined that the first account cannot occupy the first target resource and needs to wait for a certain account currently occupying the first target resource to release the first target resource.
[0074] Next, an operation of causing the first account to occupy the first target resource corresponding to the first worst account may be directly triggered.
[0075] In this embodiment, by setting a priority for a certain resource for each role, the priority of the account is determined by the priority of the role, and then by comparing the priority of the first account that currently wants to occupy the first target resource with the priority of the first worst account that currently occupies the first target resource, it is determined whether the first account can seize the first target resource. It is relatively simple to implement and has strong applicability.
[0076] Embodiment 2
[0077] This embodiment further supplements the resource occupation method for the power system in the first embodiment.
[0078] like Figure 2 FIG. 1 is a flow chart of a resource occupation method for a power system according to this embodiment. The resource occupation method includes:
[0079] Step 201, if it is identified that a first account applies to occupy a first target resource of the power system, it is determined whether the first account has a role with the authority to occupy the first target resource. If the determination result is yes, it is identified that the first account needs to occupy the first target resource of the power system, and step 202 is executed.
[0080] Each role has pre-set permissions for a certain resource. If the role has permissions, the corresponding account can occupy the first target resource. If the role does not have permissions, the corresponding account cannot occupy the first target resource. For example, ordinary users cannot occupy the resources of the configuration system.
[0081] Step 202, determining whether the first target resource is currently exhausted, if the determination result is yes, executing step 203.
[0082] Whether the first target resource can be directly allocated to the first account is determined by judging whether the first target resource is currently exhausted.
[0083] Specifically, step 202 is consistent with step 101 and will not be described in detail here.
[0084] Step 203 , determining whether the first target resource supports replacing the current account, if the determination result is yes, executing step 204 .
[0085] For some resources, they are not allowed to be preempted, such as write operations that do not support rollback and are not completed. Such operations are not allowed to be interrupted, and preemption is not allowed when occupying resources. That is, the account currently occupying the resource needs to actively release the resource before other accounts are allowed to occupy the released resource. Therefore, it is necessary to first determine whether the first target resource supports replacing the current account. If the judgment result is no, the first account cannot preempt the resource.
[0086] Step 204 , determining a first worst account among multiple accounts currently occupying the first target resource, where the first worst account is an account with the lowest priority corresponding to the first target resource among the multiple accounts.
[0087] The priority of the account is determined by the role with the highest priority for the first target resource among the target roles corresponding to the account. This step is consistent with step 102 and will not be described in detail here.
[0088] Step 205 , determining whether the priority of the first account corresponding to the first target resource is higher than the first worst account. If the determination result is yes, executing step 206 .
[0089] For each resource, priorities are set for different accounts. In this embodiment, only when the priority of the first account is higher than that of the first worst account, can the first target resource of the first worst account be preempted.
[0090] This step is consistent with step 103 and will not be described again here.
[0091] Step 206: Determine whether the first account can occupy the first target resource corresponding to the first worst account.
[0092] This step is consistent with step 104 and will not be described again here.
[0093] In this embodiment, step 203 may not exist, and the order of step 201 and step 202 may also be swapped, which can be selected according to actual needs.
[0094] In this embodiment, before determining whether the first target resource is currently exhausted, it is possible to determine whether the first account has a role that has the authority to occupy the first target resource, and after determining that the first target resource is currently exhausted, it is determined whether the first target resource supports replacing the current account, which can more reasonably determine whether the resource can be preempted.
[0095] Embodiment 3
[0096] This embodiment further supplements the resource occupation method for the power system in the above-mentioned embodiment.
[0097] like Figure 3 FIG. 1 is a flow chart of a resource occupation method for a power system according to this embodiment. The resource occupation method includes:
[0098] Step 301, if it is identified that a first account applies to occupy a first target resource of the power system, it is determined whether the first account has the authority to occupy the first target resource. If the judgment result is yes, it is identified that the first account needs to occupy the first target resource of the power system, and step 302 is executed, otherwise step 308 is executed.
[0099] Step 302 , determine whether the first target resource is currently exhausted. If the determination result is yes, execute step 303 , otherwise execute step 307 .
[0100] Step 303 , determining whether the first target resource supports replacing the current account, if the determination result is yes, executing step 304 , otherwise executing step 308 .
[0101] Step 304 , determining a first worst account among multiple accounts currently occupying the first target resource, and executing step 305 .
[0102] Step 305 , determining whether the priority of the first account corresponding to the first target resource is higher than the first worst account, if the determination result is yes, executing step 306 , otherwise executing step 308 .
[0103] Step 306 , determining that the first account can occupy the first target resource corresponding to the first worst account, kicking out the first worst account, and executing step 307 .
[0104] Step 307: Allocate a first target resource to the first account.
[0105] Step 308, stop the operation.
[0106] According to the resource occupation method for the power system of this embodiment, it is possible to determine whether the first account can occupy the first target resource in a more reasonable manner, and its execution efficiency is relatively high.
[0107] Embodiment 4
[0108] This embodiment specifically illustrates the resource occupation method for the power system of the previous embodiment. In this embodiment, resources are divided into multiple sub-resources, and can be divided according to different operations for the same object. The object here refers to the object on which the account performs operations, such as logs, settings panels, etc. For example, the resources may include a first target resource and a second target resource, the first target resource corresponding to at least one basic operation for a target object, and the second target resource corresponding to at least one advanced operation of the target object. The purpose of this division is to make more reasonable use of resources.
[0109] Here, the basic operation is, for example, a read operation, and each operation will not be separated from the basic operation. For example, a write operation is an advanced operation, and the basic operation must be performed before the advanced operation is performed. Therefore, when seizing resources, the first target resource needs to be seized first, and if the advanced operation is to be performed, the second target resource is then seized. In addition, other basic operations and advanced operations can also be set according to actual needs, which will not be repeated here. Therefore, in the present embodiment, multiple rounds of resource seizure can be performed.
[0110] like Figure 4 , which is a flow chart of a resource occupation method for a power system according to this embodiment.
[0111] Step 401, if it is identified that a first account needs to occupy a first target resource of the power system, it is determined whether the first target resource is currently exhausted, and the first account has a role with the authority to occupy the first target resource. If the judgment result is yes, step 402 is executed.
[0112] This step is consistent with the above-mentioned embodiment and will not be described again here.
[0113] Step 402, determine a first worst account among the accounts currently occupying the first target resource, the first worst account is an account with the lowest priority corresponding to the first target resource among the accounts, the priority of each account is determined by a target role with the highest priority for the first target resource among the target roles corresponding to the account, the target role is a role with authority for the first target resource, and execute step 403.
[0114] This step is consistent with the above-mentioned embodiment and will not be described again here.
[0115] Step 403 , determining whether the priority of the first account corresponding to the first target resource is higher than the priority of the first worst account corresponding to the first target resource. If the determination result is yes, executing step 404 .
[0116] Before step 403, it is also possible to determine whether the first target resource supports the operation of replacing the current account, which is consistent with the above embodiment and will not be described in detail here.
[0117] Step 404 , kick out the first worst account, the first account occupies the first target resource, and execute step 405 .
[0118] Step 405 , identifying whether the first account needs to perform a target operation, where the target operation is one of the advanced operations. If the identification result is yes, executing step 406 .
[0119] The target operation is, for example, a write operation.
[0120] Step 406 , determining whether the second target resource is exhausted, if the determination result is yes, executing step 407 .
[0121] If the second target resource is not exhausted, the second target resource is directly occupied.
[0122] Step 407 , determining a second worst account among the accounts currently occupying the second target resource, where the second worst account is an account with the lowest priority for the target operation among the accounts currently occupying the second target resource, and executing step 408 .
[0123] This step is consistent with the step of determining the first worst account and will not be repeated here.
[0124] Step 408 , determining whether the priority of the first account for the target operation is higher than that of the second worst account, if the determination result is yes, executing step 409 .
[0125] This step is consistent with the aforementioned method of comparing account priorities and will not be repeated here.
[0126] Step 409: seize the second target resource of the second worst account.
[0127] For example, the first account also occupies the first target resource. That is to say, the premise of occupying the second target resource is that the first target resource can be occupied.
[0128] According to this embodiment, resources are divided into first target resources and second target resources through different operations on the same object, so that resources can be reasonably utilized.
[0129] Embodiment 5
[0130] This embodiment specifically illustrates the resource occupation method for the power system in the above embodiment. In this embodiment, the first account has a first role, and the first role is an administrator. After the operator logs in to the first account, he wants to rewrite the log. First, he needs to read the log. Therefore, the first round needs to occupy the log reading resource.
[0131] In this embodiment, for the read log resource of the power system, that is, the object is a log, and the corresponding basic operation is a read operation. Currently, there are 5 accounts occupying the read log resource, and the read log resource can only accept 5 accounts to occupy at most at the same time. At this time, the 6th account (i.e., the first account) applies to occupy the read log resource. The roles that can occupy the read log resource are managers, developers, and observers, and the priority order of their roles is managers, developers, and observers from high to low. For the first account, it has 2 roles, namely, managers and developers, so the priority of the first account corresponds to the priority of the manager, and the account is a locally logged-in account. For the second account, it has 2 roles, namely, managers and observers, so the priority of the second account corresponds to the priority of the developer, and the second account is a remotely logged-in account. For the third and fourth accounts, they both have 1 role as a developer, and the priorities of the third and fourth accounts correspond to the priorities of the developers. For the fifth account, it has a role of observer, and the priority of the fifth account corresponds to the priority of the observer. For the sixth account that wants to occupy the first target resource, it has a role of manager, and the sixth account is a locally logged-in account. The sixth account has the permission to read logs.
[0132] The resource occupation device for the power system determines whether the log reading resource supports the replacement of the current account. If the determination result is yes, it determines whether the account has the permission to occupy the log reading resource. The final determination result is yes.
[0133] Next, the resource occupation device identifies whether the log reading resource is currently exhausted. Since the log reading resource can only be occupied by 5 accounts at most at the same time, and there are currently 5 accounts occupying it, it means that the log reading resource is currently exhausted.
[0134] Next, it is determined whether the sixth account can preempt the log reading resource.
[0135] First, determine the first worst account among the current five accounts, and compare the priority of the first account with the priority of the second account. Both account correspond to the priority of the administrator. However, since the second account is a remote login account and the first account is a local login account, the priority of the second account is lower than that of the first account. Next, compare the priority of the second account with the priority of the third account. The priority of the third account is lower than that of the second account. Next, compare the priority of the third account with the priority of the fourth account. If the priorities are the same, randomly select the priority of the third account and compare it with the priority of the fifth account to determine that the priority of the fifth account is lower than that of the third account. That is, the first worst account is the fifth account.
[0136] Next, it is determined that the priority of the sixth account is higher than that of the first worst account, so that the first worst account allocates the read log resources currently occupied by the first worst account to the sixth account.
[0137] Then, the sixth user wants to modify the log, which requires the modification log resource to be occupied. The corresponding high-level operation is a write operation. The modification log resource can only accommodate one account login. The priority of the modification log resource from high to low is still the administrator, developer, and observer. Currently, the modification log resource is occupied by the second account. The priority of the sixth account is higher than that of the second account, so the first account preempts the modification log resource of the second account and uses the modification log resource to write the log.
[0138] Embodiment 6
[0139] This embodiment provides a resource occupying device for a power system, which is used to execute the resource occupying method for a power system of the above embodiment. The resource occupying device for a power system can be any device supporting RBAC, such as a relay protection device.
[0140] like Figure 5 FIG. 2 is a schematic diagram of a resource occupation device for a power system according to the present embodiment. The resource occupation device for a power system comprises a first identification unit 501 , a first judgment unit 502 , a first determination unit 503 , a second judgment unit 504 and a second determination unit 505 .
[0141] Among them, the first identification unit 501 is used to identify whether there is a first account that needs to occupy a first target resource of the power system, and the first account has a role with the authority to occupy the first target resource. If the identification result is yes, the first judgment unit 502 is triggered; the first judgment unit 502 is used to determine whether the first target resource is currently exhausted. If the judgment result is yes, the first determination unit 503 is triggered; the first determination unit 503 is used to determine a first worst account among the accounts currently occupying the first target resource, and the first worst account is an account with the lowest priority corresponding to the first target resource among all accounts. The priority of each account is determined according to the target role with the highest priority for the first target resource among the target roles corresponding to the account, and the target role is a role with authority for the first target resource; the second judgment unit 504 is used to determine whether the priority of the first account corresponding to the first target resource is higher than the first worst account. If the judgment result is yes, the second determination unit 505 is triggered; the second determination unit 505 is used to determine that the first account can occupy the first target resource corresponding to the first worst account.
[0142] Optionally, the priority information of each target role is stored in the role information of a local or remote RBAC server.
[0143] Optionally, when the priorities of the target roles are the same, the priority of the accounts is determined based on at least one of the following factors:
[0144] The priority of the account logged in locally is higher than the priority of the account logged in remotely;
[0145] The priority of an account that occupies the first target resource for a short time is higher than the priority of an account that occupies the first target resource for a long time;
[0146] Accounts with a shorter inactivity time have a higher priority than accounts with a longer inactivity time.
[0147] The working methods of each unit in this embodiment are the same as those in the previous embodiment and will not be described again here.
[0148] In this embodiment, by setting a priority for a certain resource for each role, the priority of the account is determined by the priority of the role, and then by comparing the priority of the first account that currently wants to occupy the first target resource with the priority of the first worst account that currently occupies the first target resource, it is determined whether the first account can seize the first target resource. It is relatively simple to implement and has strong applicability.
[0149] Embodiment 7
[0150] This embodiment further supplements the resource occupying device for a power system of the sixth embodiment.
[0151] like Figure 6 As shown, the resource occupation device for the power system of this embodiment further includes a pre-judgment unit 601, and the pre-judgment unit 601 is used to:
[0152] Determine whether the first target resource supports replacing the current account;
[0153] If the judgment result is yes, the first determining unit 503 is triggered.
[0154] The working methods of each unit in this embodiment are the same as those in the previous embodiment and will not be described again here.
[0155] In this embodiment, before determining whether the first target resource is currently exhausted, it can be determined whether the first target resource supports replacing the current account, which can more reasonably determine whether the resource can be preempted.
[0156] Embodiment 8
[0157] This embodiment further supplements the resource occupying device for a power system of the previous embodiment.
[0158] In this embodiment, the first target resource corresponds to at least one basic operation for a target object, and the power system further includes a second target resource, and the second target resource corresponds to at least one advanced operation for the target object.
[0159] like Figure 7 , which is a schematic diagram of the structure of the resource occupation device for the power system according to this embodiment. The resource occupation device for the power system also includes a second identification unit 701, a third judgment unit 702, a third determination unit 703, a fourth judgment unit 704 and a fourth determination unit 705.
[0160] Among them, the second identification unit 701 is used to identify whether the first account needs to perform a target operation, which is one of the advanced operations. If the identification result is yes, the third judgment unit 702 is triggered; the third judgment unit 702 is used to determine whether the second target resources are exhausted. If the judgment result is yes, the third determination unit 703 is triggered; the third determination unit 703 is used to determine a second worst account among the accounts currently occupying the second target resources, and the second worst account is an account with the lowest priority for the target operation among the accounts currently occupying the second target resources; the fourth judgment unit 704 is used to determine whether the priority of the first account for the target operation is higher than the second worst account. If the judgment result is yes, the fourth determination unit 705 is triggered; the fourth determination unit 705 is used to determine whether the first account can seize the second target resources of the second worst account.
[0161] The working methods of each unit in this embodiment are the same as those in the previous embodiment and will not be described again here.
[0162] According to this embodiment, resources are divided into first target resources and second target resources through different operations on the same object, so that resources can be reasonably utilized.
[0163] The present invention also provides a resource occupation device for a power system, comprising at least one memory and at least one processor. The memory is used to store instructions. The processor is used to execute the resource occupation method for a power system described in any of the above embodiments according to the instructions stored in the memory.
[0164] An embodiment of the present invention further provides a readable storage medium in which machine-readable instructions are stored, and when the machine-readable instructions are executed by a machine, the machine executes the resource occupation method for a power system described in any of the above embodiments.
[0165] The readable medium stores machine-readable instructions, which, when executed by the processor, cause the processor to execute any of the aforementioned methods. Specifically, a system or device equipped with a readable storage medium may be provided, on which a software program code implementing the functions of any of the aforementioned embodiments is stored, and a computer or processor of the system or device reads and executes the machine-readable instructions stored in the readable storage medium.
[0166] In this case, the program code itself read from the machine-readable medium can realize the function of any one of the above-mentioned embodiments, and thus the machine-readable code and the machine-readable storage medium storing the machine-readable code constitute a part of the present invention.
[0167] Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, the program code may be downloaded from a server computer or a cloud via a communication network.
[0168] Those skilled in the art should understand that the various embodiments disclosed above can be modified and altered in various ways without departing from the essence of the invention. Therefore, the protection scope of the present invention should be defined by the appended claims.
[0169] It should be noted that not all steps and units in the above-mentioned processes and system structure diagrams are necessary, and some steps or units can be ignored according to actual needs. The execution order of each step is not fixed and can be adjusted as needed. The device structure described in the above-mentioned embodiments can be a physical structure or a logical structure, that is, some units may be implemented by the same physical entity, or some units may be implemented by multiple physical entities, or some components in multiple independent devices may be implemented together.
[0170] In the above embodiments, the hardware unit can be realized by mechanical means or electrical means. For example, a hardware unit or a processor can include permanent dedicated circuits or logic (such as special processors, FPGA or ASIC) to complete the corresponding operation. The hardware unit or the processor can also include programmable logic or circuits (such as general-purpose processors or other programmable processors), which can be temporarily set by software to complete the corresponding operation. Concrete implementation (mechanical means or dedicated permanent circuits or temporarily set circuits) can be determined based on cost and time considerations.
[0171] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A resource occupation method for an electric power system, wherein an electric power system includes multiple resources, an account can log in to the electric power system and occupy at least one resource, and each account corresponds to at least one role, characterized in that: The resource occupation method comprises: If it is identified that a first account needs to occupy a first target resource of the power system, it is determined whether the first target resource has been currently used up, and the first account has a role with permission to occupy the first target resource; If the judgment result is yes, then determining a first worst account among the accounts currently occupying the first target resource, the first worst account being an account with the lowest priority corresponding to the first target resource among the accounts, the priority of each account being determined according to a target role with the highest priority for the first target resource among the target roles corresponding to the account, the target role being a role having authority for the first target resource; determining whether the priority of the first account corresponding to the first target resource is higher than that of the first worst account; If the judgment result is yes, it is determined that the first account can occupy the first target resource corresponding to the first worst account.
2. The method according to claim 1, characterized in that After identifying that a first account needs to occupy a first target resource of the power system and before determining a first worst account among multiple accounts currently occupying the first target resource, the method further includes: Determining whether the first target resource supports replacing the current account; If the judgment result is yes, an operation of determining a first worst account among multiple accounts currently occupying the first target resource is performed.
3. The method according to claim 1, characterized in that The first target resource corresponds to at least one basic operation for a target object, the power system further comprises a second target resource, the second target resource corresponds to at least one advanced operation for the target object, After the first account occupies the first target resource corresponding to the first worst account, the method further includes: identifying whether the first account needs to perform a target operation, where the target operation is one of the advanced operations; If the identification result is yes, determining whether the second target resource is exhausted; If the judgment result is yes, determining a second worst account among the accounts currently occupying the second target resource, where the second worst account is an account with the lowest priority for the target operation among the accounts currently occupying the second target resource; Determining whether the priority of the first account for the target operation is higher than that of the second worst account; If the judgment result is yes, it is determined that the first account can preempt the second target resource of the second worst account.
4. The method according to claim 1, characterized in that The priority information of each target role is stored in the role information of the local or remote RBAC server.
5. The method according to any one of claims 1 to 4, characterized in that When the priority of the target roles is the same, the priority of the account is determined based on at least one of the following factors: The priority of the account logged in locally is higher than the priority of the account logged in remotely; The priority of an account that occupies the first target resource for a short time is higher than the priority of an account that occupies the first target resource for a long time; Accounts with a shorter inactivity time have a higher priority than accounts with a longer inactivity time.
6. A resource occupation device for an electric power system, wherein an electric power system includes multiple resources, an account can log in to the electric power system and occupy at least one resource, and each account corresponds to at least one role, characterized in that: The resource occupying device comprises: a first identification unit, used to identify whether a first account needs to occupy a first target resource of the power system, and whether the first account has a role with permission to occupy the first target resource, and if the identification result is yes, triggering a first judgment unit; The first judging unit is used to judge whether the first target resource is currently exhausted, and if the judgment result is yes, trigger a first determining unit; The first determining unit is used to determine a first worst account among the accounts currently occupying the first target resource, the first worst account being an account with the lowest priority corresponding to the first target resource among the accounts, the priority of each account being determined according to a target role with the highest priority for the first target resource among the target roles corresponding to the account, the target role being a role having authority for the first target resource; a second judging unit, configured to judge whether the priority of the first account corresponding to the first target resource is higher than that of the first worst account, and if the judgment result is yes, triggering a second determining unit; The second determining unit is configured to determine whether the first account can occupy the first target resource corresponding to the first worst account.
7. The device according to claim 6, characterized in that The invention also includes a pre-judgment unit, wherein the pre-judgment unit is used to: Determining whether the first target resource supports replacing the current account; If the judgment result is yes, the first determining unit is triggered.
8. The device according to claim 6, characterized in that The first target resource corresponds to at least one basic operation for a target object, the power system further includes a second target resource, the second target resource corresponds to at least one advanced operation for the target object, and the device further includes: a second identification unit, configured to identify whether the first account needs to perform a target operation, wherein the target operation is one of the advanced operations, and if the identification result is yes, triggering a third judgment unit; The third judging unit is used to judge whether the second target resource is exhausted, and if the judgment result is yes, trigger a third determining unit; The third determining unit is used to determine a second worst account among the accounts currently occupying the second target resource, where the second worst account is an account with the lowest priority for the target operation among the accounts currently occupying the second target resource; a fourth judging unit, configured to judge whether the priority of the first account for the target operation is higher than that of the second worst account, and if the judgment result is yes, trigger a fourth determining unit; The fourth determining unit is configured to determine whether the first account can preempt the second target resource of the second worst account.
9. The device according to any one of claims 6 to 8, characterized in that The priority information of each target role is stored in the role information of a local or remote RBAC server; and / or When the priority of the target roles is the same, the priority of the account is determined based on at least one of the following factors: The priority of the account logged in locally is higher than the priority of the account logged in remotely; The priority of an account that occupies the first target resource for a short time is higher than the priority of an account that occupies the first target resource for a long time; Accounts with a shorter inactivity time have a higher priority than accounts with a longer inactivity time.
10. A resource occupation device for an electric power system, characterized in that: include: at least one memory for storing instructions; At least one processor is configured to execute the resource occupying device for a power system according to any one of claims 1 to 5 according to the instructions stored in the memory.
11. A readable storage medium, characterized in that: The readable storage medium stores machine-readable instructions. When the machine-readable instructions are executed by a machine, the machine executes the resource occupying device for a power system according to any one of claims 1-5.