Software authorization determination method and device, electronic equipment and storage medium

By obtaining and comparing the current and initial deployment environment information of the target software, service dependencies are generated, which solves the problem that existing software authorization protection is easily cracked, and achieves stronger software authorization protection.

CN118797579APending Publication Date: 2024-10-18CHINA MOBILE M2M +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410298239.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-15
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

Existing software authorization protection methods are easily cracked, and software protected through encrypted calculations or registration machines is difficult to effectively protect against packet capture and modification at the software level or in the network.

Method used

By obtaining the current environment information of the target software, the dependencies between services are generated, and the startup location is compared with the standard dependencies during initial deployment. If they do not match, the startup is stopped and the software is judged to be unauthorized.

Benefits of technology

It effectively prevents unauthorized operation of the software, improves the protection intensity of the software and avoids the risk of cracking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118797579A_ABST
    Figure CN118797579A_ABST
Patent Text Reader

Abstract

The invention relates to a software authorization determination method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining the current environment information of target software under the condition that the target software needs to be started; based on the current environment information, generating a current dependency relationship among services in the target software; in the starting process of the target software, obtaining a starting position of a target service in the target software in the current dependency relationship; under the condition that the starting position is different from a target position in a standard dependency relationship among services in the target software, stopping starting the target service, and determining that the software is not authorized; wherein the standard dependency relationship is determined based on environment information of the target software during initial deployment. In this way, by comparing whether the starting position of the target service in the current dependency relationship is the same as the starting position in the standard dependency relationship or not, a judgment result about whether the software is authorized or not is obtained, and therefore better authorization protection can be conducted on the software.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for determining software authorization. Background Art

[0002] With the continuous development of technology, many software currently require authorization to run normally. The software authorization protection methods in the current related technologies are mainly carried out through encryption calculation or registration machine for authorization protection.

[0003] However, the authorization protection method through encryption calculation can be cracked at the software level, and the authorization protection method through the registration machine can be cracked by modifying the target address of the software registration machine or capturing and modifying the packet in the network. Therefore, the software authorization protection method in the related art has the problem of being easily cracked. Summary of the invention

[0004] The present disclosure provides a method, device, electronic device and storage medium for determining software authorization.

[0005] According to a first aspect of the present disclosure, a method for determining software authorization is provided, the method comprising:

[0006] When the target software needs to be started, obtaining the current environment information of the target software;

[0007] Based on the current environment information, generate current dependencies between services in the target software;

[0008] During the startup of the target software, obtaining the startup position of the target service in the target software in the current dependency relationship;

[0009] When the startup position is different from the target position in the standard dependency relationship between the services in the target software, the target service is stopped from being started and it is determined that the software is not authorized; wherein the standard dependency relationship is determined based on the environment information of the target software when it is first deployed.

[0010] Optionally, the method further comprises:

[0011] Obtaining environment information of the target software when it is first deployed;

[0012] Based on the initial deployment environment information, hash values ​​corresponding to the services in the target software are obtained, and standard dependency relationships between the services are determined based on the hash values.

[0013] Optionally, determining the standard dependency relationship between the services based on the hash value includes:

[0014] Generate a consistent hash ring based on the hash values ​​corresponding to each of the services;

[0015] Determine the positions of the respective services in the consistent hash ring, and determine the standard dependency relationships between the respective services based on the positions of the respective services in the consistent hash ring.

[0016] Optionally, the method further comprises:

[0017] Based on the current dependency relationship, obtaining the startup status of the first service that the target service depends on when it is started;

[0018] When the startup status of the first service is not started normally, the steps of stopping and starting the target service and determining that the software is not authorized are performed.

[0019] Optionally, the method further comprises:

[0020] When the startup state of the first service is a normal startup state and the startup position is the same as the target position of the target service in the standard dependency relationship, the target service is started.

[0021] Optionally, generating the current dependency relationship between services in the target software based on the current environment information includes:

[0022] Based on the current environment information, obtain the hash value corresponding to each service in the target software;

[0023] Based on the hash values ​​corresponding to the services, a current consistent hash ring is generated, and the positions of the services in the current consistent hash ring are determined;

[0024] Based on the positions of the services in the current consistent hash ring, the current dependency relationship between the services in the target software is obtained.

[0025] Optionally, the environmental information includes at least one of the following: IP address, MAC address and target hardware information.

[0026] According to a second aspect of the present disclosure, a device for determining software authorization is provided, the device comprising:

[0027] An environment information acquisition module is used to acquire the current environment information of the target software when the target software needs to be started;

[0028] A dependency generation module, used to generate current dependencies between services in the target software based on the current environment information;

[0029] A startup position acquisition module, used for acquiring the startup position of a target service in the target software in the current dependency relationship during the startup of the target software;

[0030] A service processing module, used to stop starting the target service and determine that the software is not authorized when the startup position is different from the target position in the standard dependency relationship between the services in the target software; wherein the standard dependency relationship is determined based on the environmental information of the target software when it is first deployed.

[0031] Optionally, the device further comprises:

[0032] The environment information acquisition module is also used to obtain the environment information of the target software when it is first deployed;

[0033] The standard dependency determination module is used to obtain the hash values ​​corresponding to the various services in the target software based on the environment information during the initial deployment, and determine the standard dependency between the services based on the hash values.

[0034] Optionally, the standard dependency determination module is specifically used to:

[0035] Generate a consistent hash ring based on the hash values ​​corresponding to each of the services;

[0036] Determine the positions of the respective services in the consistent hash ring, and determine the standard dependency relationships between the respective services based on the positions of the respective services in the consistent hash ring.

[0037] Optionally, the device further comprises:

[0038] A startup status acquisition module, used to acquire the startup status of the first service that the target service depends on when it is started, based on the current dependency relationship;

[0039] The service processing module is further used to stop starting the target service when the startup status of the first service is abnormal startup, and determine that the software is not authorized.

[0040] Optionally, the device further comprises:

[0041] The service startup module is used to start the target service when the startup state of the first service is a normal startup state and the startup position is the same as the target position of the target service in the standard dependency relationship.

[0042] Optionally, the dependency generation module is specifically used to:

[0043] Based on the current environment information, obtain the hash value corresponding to each service in the target software;

[0044] Based on the hash values ​​corresponding to the services, a current consistent hash ring is generated, and the positions of the services in the current consistent hash ring are determined;

[0045] Based on the positions of the services in the current consistent hash ring, the current dependency relationship between the services in the target software is obtained.

[0046] Optionally, the environmental information includes at least one of the following: IP address, MAC address and target hardware information.

[0047] According to a third aspect of the present disclosure, an electronic device is provided, which includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the program, the method described above is implemented.

[0048] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above method of the present disclosure is implemented.

[0049] The software authorization determination method, device, electronic device and storage medium provided by the embodiments of the present disclosure, when it is necessary to start the target software, obtain the current environment information of the target software, and generate the current dependency relationship between the services in the target software based on the current environment information. During the target software startup process, the startup position of the target service in the target software in the current dependency relationship is obtained, and when the startup position is different from the target position in the standard dependency relationship between the services in the target software, the startup of the target service is stopped, and it is determined that the software is not authorized. Among them, the standard dependency relationship is determined based on the environment information of the target software when it is first deployed. In this way, by comparing whether the startup position of the target service in the current dependency relationship is the same as the startup position in the standard dependency relationship, a judgment result of whether the software is authorized is obtained, which can better authorize and protect the software. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Further details, features and advantages of the present disclosure are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:

[0051] Figure 1 A schematic diagram of a scenario provided for an exemplary embodiment of the present disclosure;

[0052] Figure 2 A flowchart of a method for determining software authorization provided by an exemplary embodiment of the present disclosure;

[0053] Figure 3 A schematic block diagram of functional modules of a device for determining software authorization provided by an exemplary embodiment of the present disclosure;

[0054] Figure 4 A structural block diagram of an electronic device provided for an exemplary embodiment of the present disclosure;

[0055] Figure 5 A structural block diagram of a computer system provided for an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0056] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0057] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0058] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0059] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0060] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0061] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0062] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0063] As an optional but non-limiting implementation, in response to receiving an active request from the user, the method of sending a prompt message to the user may be, for example, a pop-up window, in which the prompt message may be presented in text. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device. It is understandable that the above notification and the process of obtaining user authorization are only illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0064] Generally, when software is started, multiple services in the software are started gradually, and these services usually have dependencies. Service dependency refers to the situation where a service needs to rely on other services to run normally. In the microservice architecture, the dependency between services is very important, because the failure of one service may affect the normal operation of other services. Therefore, the dependency between services needs to be managed and monitored to ensure the stability and reliability of the entire system.

[0065] Service dependencies can be divided into two types: hard dependencies and soft dependencies. A hard dependency means that a service must rely on another service to run properly. If the dependent service fails, the dependent service will also be affected. A soft dependency means that a service can choose to rely on another service, but it is not required. If the dependent service fails, the dependent service can continue to run, but may be affected to a certain extent.

[0066] The disclosed embodiments are based on the idea of ​​service dependency. When each service in the software is started, it checks its own dependency relationship. If the dependency relationship is abnormal, it refuses to start, thereby determining whether the service is authorized to run.

[0067] In the embodiment, in a large system, a common system architecture is usually composed of multiple sub-services, each of which has its own functions and responsibilities and also depends on other sub-services. In the embodiment provided by the present disclosure, the sub-services involved include the various sub-services that constitute the system, which are mainly responsible for executing the various business logics of the system.

[0068] The control end in the embodiment can be a service modified based on the registration center. In addition to assuming the functions of the registration center, it can also be used to calculate the dependency relationship of the service, and inform the service whether the position on the dependency chain is legal by providing an interface, so as to control the startup of the service. The dependency chain can be regarded as a specific presentation of the above dependency relationship, and the dependency chain can be a hash ring, which will be specifically introduced in the following embodiment.

[0069] When the system is first deployed, the system startup script will be generated using the calculation method of the control end's dependency chain position. The script will determine the startup order of the services based on the position of the dependency chain to ensure that the entire system can start normally. It should be noted that the system startup script does not have the calculation function, but is calculated by the system toolbox and is used to start the services in the order in which they are started.

[0070] In the embodiments provided by the present disclosure, a system toolbox may be used to collect environmental noise of services according to configuration information of each service to generate a system startup script, wherein the environmental noise may include an IP address, a MAC address or related hardware information.

[0071] By starting the control end service, the service will generate a dependency chain according to the environmental noise to obtain the dependency relationship between the services. The dependency relationship reflects the startup sequence between the services, that is, each service has its own corresponding startup position during the startup process.

[0072] It should be noted that the dependency is determined based on the current environment of the service. If the environment changes, the environmental noise will also change, and the dependency obtained will also change.

[0073] In the embodiment, the system startup script is used to start the services in sequence, and the services initiate a startup request to the control end after completing the initialization. The control end calculates the position of the current service in the dependency chain based on the requested information, and rejects the startup request of the service if the position of the service in the dependency chain is illegal or the current service dependent party is not started normally, otherwise the service is allowed to start.

[0074] If the response received by the system service is normal, the current service completes the startup; if the response is a rejection, the current service rejects the startup and can re-initiate the startup request after a period of time.

[0075] Based on the above embodiments, the software authorization protection based on service dependency in the disclosed embodiments mainly relies on the generation of the dependency chain and the control of service startup. This method does not require any modification to the service, and only requires sending a request to the control end when the service is started. At the same time, since the verification mechanism is performed when the service is started, only when the service is started in the correct order can the entire system be started correctly, so this method can effectively prevent the service from being cracked.

[0076] Regarding the security of the control end itself, since the control end is a service modified based on the registration center, if you simply replace the registration center and use mechanisms such as the registration machine to crack it, the sub-services in the system will not be able to execute business logic normally because the service consumers cannot obtain the service provider's information normally after connecting to the registration center.

[0077] In the microservice architecture, most GRPC (open source remote procedure call) frameworks support HTTPS (Hypertext Transfer Protocol Secure) for communication. Therefore, HTTPS can be used to ensure the security of communication between services to prevent information from being tampered with during the communication process. At the same time, the transmitted messages will be signed according to the environmental noise of the request to prevent the request from being forged.

[0078] It should be noted that the embodiments of the present disclosure need to ensure that they can take effect even when the system is restarted, powered off, or moved.

[0079] For the first case mentioned above, when an individual service in the system is restarted, since the verification of software authorization only occurs during the startup process of the service, that is, when the service is restarted, its upstream and downstream services will not verify whether the information of the dependents has changed. The restarted service verifies whether the services it depends on are normal at startup, and the dependency relationship between services is determined based on environmental noise, so the operation of the entire system will not be affected.

[0080] For the second situation mentioned above, in case of emergency, such as sudden power outage, which causes the entire system to be forced to shut down, it is necessary to first restore the normal operation of each server on which the service depends, and then start them according to the system startup script in the startup order of the service.

[0081] When restarting, if the service itself is running on a bare metal server, the IP and other information should be set to fixed information when the server is first deployed. In addition, the MAC and hardware information will not change because they are related to the hardware. Therefore, it can be ensured that after the service is restarted, the position of the service in the dependency chain will not change. Just start it normally according to the order of the startup script.

[0082] If the service runs on virtual technologies such as virtual machines or Kubernetes containers, when deploying the service, it is required to fix the IP address that the service depends on according to the characteristics of virtualization. At the same time, since virtualization technology automatically generates a MAC address when creating a network card, subsequent emergencies of this type will not affect the hardware information generated when the virtual environment is initialized. Therefore, it can be guaranteed that after the service is restarted, the position of the service in the dependency chain will not change, and it can be started normally according to the order of the startup script.

[0083] For the third case mentioned above, when the system is migrated to a new environment, if the overall server environment is a brand new environment, then deployment can be performed according to the above deployment process. At this time, due to the change in environmental noise, the position of the service on the dependency chain will change. Therefore, when the system startup script is re-executed, since the dependency chain on the control end has not changed, the position of the sub-services on their dependency chain at startup has shifted, and the initial dependency relationship cannot be obtained at startup, and it will fall into an infinite restart loop.

[0084] In an embodiment, a dependency chain of a service may be constructed using a consistent hash ring, which distributes data to multiple nodes through a consistent hash algorithm and ensures that each node can be evenly distributed throughout the ring.

[0085] In the embodiment, each service generates a unique hash value according to the environmental noise, and then inserts the hash value into the consistent hash ring. Finally, the nodes in the ring are sorted in a clockwise direction, so that the position of the current service in the dependency chain can be calculated, such as Figure 1 As shown, Figure 1 The corresponding positions of the four services in the dependency chain.

[0086] Since the environmental noise is fixed before the large service is deployed, the hash value generated based on the environmental noise will not change. This ensures that the position of the service in the dependency chain will not change, thereby ensuring that the dependency chain will not change due to a restart of the service.

[0087] Assume there are three services A, B, and C, and their IP addresses and MAC addresses are as follows:

[0088] a) Service A: IP address is 192.168.1.1, MAC address is 00:11:22:33:44:55;

[0089] b) Service B: IP address is 192.168.1.2, MAC address is 11:22:33:44:55:66;

[0090] c) Service C: IP address is 192.168.1.3, MAC address is 22:33:44:55:66:77;

[0091] Now we need to map them to the consistent hash ring. We can do this by following these steps:

[0092] 1. Concatenate the IP address and MAC address to get the following string:

[0093] a) Service A: 192.168.1.1-00:11:22:33:44:55;

[0094] b) Service B: 192.168.1.2-11:22:33:44:55:66;

[0095] c) Service C: 192.168.1.3-22:33:44:55:66:77;

[0096] 2. Use a hash function to map these strings to a fixed hash value. For example, using the MD5 hash function, you can get the following hash value:

[0097] a) Service A: d0f5c7b3dcbf5d5a3b8f1f9e4c7c1c1a;

[0098] b) Service B: f7b3f5d5a3b8f1f9e4c7c1c1ad0f5c7b;

[0099] c) Service C: 5a3b8f1f9e4c7c1c1ad0f5c7b3dcbf5d;

[0100] 3. Assign the hash values ​​to a circular hash space. For example, using a 3-bit hash space, we get the following distribution:

[0101] a) Service A: 0x1;

[0102] b) Service B: 0x2;

[0103] c) Service C: 0x0;

[0104] 4. Map each service to a position in the circular hash space. For example, assume that service A is mapped to 0x1, service B is mapped to 0x2, and service C is mapped to 0x0.

[0105] 5. Sort all positions, for example, in ascending order, and you can get the following arrangement:

[0106] a) Service C: 0x0

[0107] b) Service A: 0x1

[0108] c) Service B: 0x2

[0109] 6. Get the dependency chain: CA–B;

[0110] In the embodiment, when mapping the service to the hash ring based on the hash value corresponding to the service, for example, if there are 3 services, the hash values ​​corresponding to the 3 services can be divided by 3, and the positions of the 3 services on the hash ring can be sorted according to the size of the remainder to obtain the dependency relationship between the services. If the software is used illegally, the environmental noise corresponding to the service changes when the software is started, and the hash values ​​corresponding to the services will also change, so that their positions on the hash ring will also change, resulting in changes in the dependency relationship between the services, which will cause the software to fail to start normally, thereby protecting the authorization of the software.

[0111] In the embodiments provided by the present disclosure, environmental noise information of each sub-service needs to be collected during the software deployment phase, and this information includes at least one of the IP address, MAC address, and hardware information such as the motherboard. It should be noted that if a virtual machine or container deployment is adopted, it needs to be designed according to the plan to ensure the uniqueness of the corresponding information of the service.

[0112] By injecting the collected service information into the toolbox, the toolbox will calculate the position of each service in the dependency chain according to the calculation rules of the dependency chain, and then generate a startup script based on the position of the service.

[0113] It should be noted that the software in the embodiment may specifically be a certain system, such as an operating system, or application software, etc., and the embodiment is not limited thereto.

[0114] Based on the above embodiments, the present disclosure also provides a method for determining software authorization, such as Figure 2 As shown, the method may include the following steps:

[0115] In step S210, when the target software needs to be started, the current environment information of the target software is obtained.

[0116] In an embodiment, the environmental information may be at least one of an IP address, a MAC address and target hardware information, and the environmental information will not change with a system restart or power failure, etc. The environmental information may specifically be the environmental noise in the above embodiment.

[0117] In step S220, the current dependency relationship between services in the target software is generated based on the current environment information.

[0118] In an embodiment, the hash values ​​corresponding to each service in the target software can be obtained based on the current environment information. Based on the hash values ​​corresponding to each service, the current consistent hash ring is generated, and the position of each service in the current consistent hash ring is determined. In this way, the current dependency relationship between services in the target software can be obtained based on the position of each service in the current consistent hash ring.

[0119] Since the software may contain multiple services during startup, there will be dependencies between services. For example, the next service needs to rely on the normal startup of the previous service. The current environment information of each service is different, so the hash values ​​corresponding to each service obtained based on the environment information will also be different. In this way, in the hash ring obtained based on the hash value of each service, the corresponding positions of each service on the hash ring are also different, thereby obtaining the dependency relationship between the services.

[0120] In step S230, during the target software startup process, the startup position of the target service in the target software in the current dependency relationship is obtained.

[0121] In an embodiment, the startup position is the position corresponding to the target service in the above-mentioned hash ring.

[0122] In step S240, if the start position is not the same as the target position in the standard dependency relationship between services in the target software, the target service is stopped and it is determined that the software is not authorized. The standard dependency relationship is determined based on the environment information of the target software when it is first deployed.

[0123] In the case where the startup position is different from the target position in the standard dependency relationship between the services in the target software, it means that the environment of the target service has changed, causing its current environment to be different from the environment at the time of initial deployment, so the startup position obtained is different from the corresponding position at the time of initial deployment.

[0124] In the embodiment, the dependency relationship between services is constructed by the current environment when the software is started, and the startup sequence between the services is obtained. In addition, the startup sequence between the services is obtained by obtaining the dependency relationship between the services obtained according to the environment information at the time of the initial deployment of the software. In this way, during the startup process of the target service, if the startup position determined according to the current environment information is different from the startup position corresponding to the initial deployment, that is, the position of the target service in the dependency relationship has changed, it means that the software is illegally used, so the startup of the target service can be stopped.

[0125] The method for determining software authorization provided by the embodiment of the present disclosure, when it is necessary to start the target software, obtains the current environment information of the target software, and generates the current dependency relationship between the services in the target software based on the current environment information. During the startup process of the target software, the startup position of the target service in the target software in the current dependency relationship is obtained, and when the startup position is different from the target position in the standard dependency relationship between the services in the target software, the startup of the target service is stopped, and it is determined that the software is not authorized. Among them, the standard dependency relationship is determined based on the environment information of the target software when it is first deployed. In this way, by comparing whether the startup position of the target service in the current dependency relationship is the same as the startup position in the standard dependency relationship, a judgment result of whether the software is authorized is obtained, which can better authorize and protect the software.

[0126] Based on the above embodiment, in another embodiment provided by the present disclosure, the above method may further include the following steps:

[0127] In step S250, the environment information of the target software during initial deployment is obtained.

[0128] In step S260, based on the environment information during the initial deployment, the hash values ​​corresponding to the services in the target software are obtained, and the standard dependency relationship between the services is determined based on the hash values.

[0129] In the embodiment, a consistent hash ring can be generated based on the hash values ​​corresponding to each service, the position of each service in the consistent hash ring can be determined, and the standard dependency between services can be determined based on the position of each service in the consistent hash ring. Based on the environmental information, the corresponding hash value is obtained, and a hash ring is generated based on the hash value, and the position on the hash ring is determined by the hash value of each service, which is consistent with the method of the above embodiment and will not be repeated here.

[0130] Based on the above embodiment, in another embodiment provided by the present disclosure, the startup status of the first service that the target service depends on when it is started can also be obtained based on the current dependency relationship between the services in the above target software. And when the startup status of the first service is not started normally, the target service is stopped and it is determined that the software is not authorized.

[0131] In the embodiment, the target service can be any service in the startup process of the target software, and the first service can be a service that the target service depends on when it is started. When the first service is started normally, that is, when the startup status of the first service is normal startup, the target service can be started normally and continue the startup process of subsequent services. When the startup status of the first service is not started normally, the target service is stopped.

[0132] Therefore, in the embodiment, when the startup state of the first service is a normal startup state and the startup position of the target service in the current dependency relationship is the same as the target position of the target service in the standard dependency relationship, the target service is started.

[0133] In the case of dividing each functional module according to each function, the embodiment of the present disclosure provides a device for determining software authorization, and the device for determining software authorization can be a server, a terminal, or a chip applied to the server. Figure 3 A schematic block diagram of the functional modules of a software authorization determination device provided by an exemplary embodiment of the present disclosure. Figure 3 As shown, the software authorization determination device includes:

[0134] The environment information acquisition module 10 is used to acquire the current environment information of the target software when the target software needs to be started;

[0135] A dependency generation module 20, for generating current dependencies between services in the target software based on the current environment information;

[0136] A startup position acquisition module 30, used for acquiring the startup position of the target service in the target software in the current dependency relationship during the startup process of the target software;

[0137] The service processing module 40 is used to stop starting the target service and determine that the software is not authorized when the startup position is different from the target position in the standard dependency relationship between the services in the target software; wherein the standard dependency relationship is determined based on the environmental information of the target software when it is first deployed.

[0138] Optionally, the device further comprises:

[0139] The environment information acquisition module is also used to obtain the environment information of the target software when it is first deployed;

[0140] The standard dependency determination module is used to obtain the hash values ​​corresponding to the various services in the target software based on the environment information during the initial deployment, and determine the standard dependency between the services based on the hash values.

[0141] Optionally, the standard dependency determination module is specifically used to:

[0142] Generate a consistent hash ring based on the hash values ​​corresponding to each of the services;

[0143] Determine the positions of the respective services in the consistent hash ring, and determine the standard dependency relationships between the respective services based on the positions of the respective services in the consistent hash ring.

[0144] Optionally, the device further comprises:

[0145] A startup status acquisition module, used to acquire the startup status of the first service that the target service depends on when it is started, based on the current dependency relationship;

[0146] The service processing module is further used to stop starting the target service when the startup status of the first service is abnormal startup, and determine that the software is not authorized.

[0147] Optionally, the device further comprises:

[0148] The service startup module is used to start the target service when the startup state of the first service is a normal startup state and the startup position is the same as the target position of the target service in the standard dependency relationship.

[0149] Optionally, the dependency generation module is specifically used to:

[0150] Based on the current environment information, obtain the hash value corresponding to each service in the target software;

[0151] Based on the hash values ​​corresponding to the services, a current consistent hash ring is generated, and the positions of the services in the current consistent hash ring are determined;

[0152] Based on the positions of the services in the current consistent hash ring, the current dependency relationship between the services in the target software is obtained.

[0153] Optionally, the environmental information includes at least one of the following: IP address, MAC address and target hardware information.

[0154] The relevant device part corresponds to the above method. For details, please refer to the description of the embodiment corresponding to the above method, which will not be repeated here.

[0155] The software authorization determination device provided by the embodiment of the present disclosure, when it is necessary to start the target software, obtains the current environment information of the target software, and generates the current dependency relationship between the services in the target software based on the current environment information. During the target software startup process, the startup position of the target service in the target software in the current dependency relationship is obtained, and when the startup position is different from the target position in the standard dependency relationship between the services in the target software, the startup of the target service is stopped, and it is determined that the software is not authorized. Among them, the standard dependency relationship is determined based on the environment information of the target software when it is first deployed. In this way, by comparing whether the startup position of the target service in the current dependency relationship is the same as the startup position in the standard dependency relationship, a judgment result of whether the software is authorized is obtained, which can better authorize and protect the software.

[0156] An embodiment of the present disclosure also provides an electronic device, comprising: at least one processor; and a memory for storing instructions executable by the at least one processor; wherein the at least one processor is configured to execute the instructions to implement the above method disclosed in the embodiment of the present disclosure.

[0157] Figure 4 The structure diagram of an electronic device provided by an exemplary embodiment of the present disclosure is shown in FIG. Figure 4 As shown, the electronic device 1800 includes at least one processor 1801 and a memory 1802 coupled to the processor 1801 , and the processor 1801 can execute corresponding steps in the above method disclosed in the embodiment of the present disclosure.

[0158] The processor 1801 may also be referred to as a central processing unit (CPU), which may be an integrated circuit chip having signal processing capabilities. Each step in the method disclosed in the embodiment of the present disclosure may be completed by an integrated logic circuit of hardware in the processor 1801 or by instructions in the form of software. The processor 1801 may be a general-purpose processor, a digital signal processor (DSP), an ASIC, a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present disclosure may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in a decoding processor. The software module may be located in a memory 1802, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, or other mature storage media in the art. The processor 1801 reads the information in the memory 1802 and completes the steps of the method in combination with its hardware.

[0159] In addition, when various operations / processes according to the present disclosure are implemented by software and / or firmware, they can be transmitted from a storage medium or a network to a computer system having a dedicated hardware structure, such as Figure 5 The computer system 1900 shown is installed with the programs constituting the software. When the various programs are installed, the computer system can perform various functions, including the functions described above. Figure 5 A structural block diagram of a computer system provided for an exemplary embodiment of the present disclosure.

[0160] Computer system 1900 is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0161] like Figure 5As shown, the computer system 1900 includes a computing unit 1901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1902 or a computer program loaded from a storage unit 1908 to a random access memory (RAM) 1903. In the RAM 1903, various programs and data required for the operation of the computer system 1900 can also be stored. The computing unit 1901, the ROM 1902, and the RAM 1903 are connected to each other via a bus 1904. An input / output (I / O) interface 1905 is also connected to the bus 1904.

[0162] A plurality of components in the computer system 1900 are connected to the I / O interface 1905, including: an input unit 1906, an output unit 1907, a storage unit 1908, and a communication unit 1909. The input unit 1906 may be any type of device capable of inputting information to the computer system 1900, and the input unit 1906 may receive input digital or character information, and generate key signal inputs related to user settings and / or function control of the electronic device. The output unit 1907 may be any type of device capable of presenting information, and may include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 1908 may include, but is not limited to, a disk, an optical disk. The communication unit 1909 allows the computer system 1900 to exchange information / data with other devices over a network such as the Internet, and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth™ device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.

[0163] The computing unit 1901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1901 performs the various methods and processes described above. For example, in some embodiments, the above methods disclosed in the embodiments of the present disclosure may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 1908. In some embodiments, part or all of the computer program may be loaded and / or installed on an electronic device via ROM 1902 and / or communication unit 1909. In some embodiments, the computing unit 1901 may be configured to perform the above methods disclosed in the embodiments of the present disclosure in any other appropriate manner (e.g., by means of firmware).

[0164] The embodiment of the present disclosure further provides a computer-readable storage medium, wherein when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the above method disclosed in the embodiment of the present disclosure.

[0165] The computer-readable storage medium in the disclosed embodiments may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. The computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. More specifically, the computer-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0166] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0167] The embodiments of the present disclosure further provide a computer program product, including a computer program, wherein when the computer program is executed by a processor, the above method disclosed in the embodiments of the present disclosure is implemented.

[0168] In embodiments of the present disclosure, computer program codes for performing the operations of the present disclosure may be written in one or more programming languages ​​or combinations thereof, including but not limited to object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer.

[0169] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0170] The modules, components or units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the names of the modules, components or units do not, in some cases, limit the modules, components or units themselves.

[0171] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0172] The above descriptions are only some embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, a technical solution formed by replacing the above features with the technical features with similar functions disclosed in the present disclosure (but not limited to).

[0173] Although some specific embodiments of the present disclosure have been described in detail by way of example, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present disclosure. It should be understood by those skilled in the art that the above embodiments may be modified without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.

Claims

1. A method for determining software authorization, characterized in that: The method comprises: When the target software needs to be started, obtaining the current environment information of the target software; Based on the current environment information, generate current dependencies between services in the target software; During the startup of the target software, obtaining the startup position of the target service in the target software in the current dependency relationship; When the startup position is different from the target position in the standard dependency relationship between the services in the target software, the target service is stopped from being started and it is determined that the software is not authorized; wherein the standard dependency relationship is determined based on the environment information of the target software when it is first deployed.

2. The method according to claim 1, characterized in that The method further comprises: Obtaining environment information of the target software when it is first deployed; Based on the initial deployment environment information, hash values ​​corresponding to the services in the target software are obtained, and standard dependency relationships between the services are determined based on the hash values.

3. The method according to claim 2, characterized in that The determining the standard dependency relationship between the services based on the hash value includes: Generate a consistent hash ring based on the hash values ​​corresponding to each of the services; Determine the positions of the respective services in the consistent hash ring, and determine the standard dependency relationships between the respective services based on the positions of the respective services in the consistent hash ring.

4. The method according to claim 1, characterized in that: The method further comprises: Based on the current dependency relationship, obtaining the startup status of the first service that the target service depends on when it is started; When the startup status of the first service is not started normally, the steps of stopping and starting the target service and determining that the software is not authorized are performed.

5. The method according to claim 4, characterized in that The method further comprises: When the startup state of the first service is a normal startup state and the startup position is the same as the target position of the target service in the standard dependency relationship, the target service is started.

6. The method according to claim 1, characterized in that The generating, based on the current environment information, current dependencies between services in the target software includes: Based on the current environment information, obtain the hash value corresponding to each service in the target software; Based on the hash values ​​corresponding to the services, a current consistent hash ring is generated, and the positions of the services in the current consistent hash ring are determined; Based on the positions of the services in the current consistent hash ring, the current dependency relationship between the services in the target software is obtained.

7. The method according to any one of claims 1 to 6, characterized in that: The environmental information includes at least one of the following: IP address, MAC address and target hardware information.

8. A device for determining software authorization, characterized in that: The device comprises: An environment information acquisition module is used to acquire the current environment information of the target software when the target software needs to be started; A dependency generation module, used to generate current dependencies between services in the target software based on the current environment information; A startup position acquisition module, used for acquiring the startup position of a target service in the target software in the current dependency relationship during the startup of the target software; A service processing module, used to stop starting the target service and determine that the software is not authorized when the startup position is different from the target position in the standard dependency relationship between the services in the target software; wherein the standard dependency relationship is determined based on the environmental information of the target software when it is first deployed.

9. An electronic device, characterized in that: include: at least one processor; a memory for storing the at least one processor-executable instruction; The at least one processor is configured to execute the instructions to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method as claimed in any one of claims 1 to 7.