CN118445102A - Conflict detection method and device, electronic equipment and storage medium - Google Patents
Conflict detection method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN118445102A CN118445102A CN202410501361.8A CN202410501361A CN118445102A CN 118445102 A CN118445102 A CN 118445102A CN 202410501361 A CN202410501361 A CN 202410501361A CN 118445102 A CN118445102 A CN 118445102A
- Authority
- CN
- China
- Prior art keywords
- license
- item
- licenses
- conflict
- detected
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 93
- 230000001419 dependent effect Effects 0.000 claims abstract description 143
- 238000000034 method Methods 0.000 claims abstract description 43
- 238000012545 processing Methods 0.000 claims description 21
- 238000004590 computer program Methods 0.000 claims description 11
- 238000005516 engineering process Methods 0.000 abstract description 6
- 238000010586 diagram Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 8
- 230000008569 process Effects 0.000 description 6
- 239000007787 solid Substances 0.000 description 5
- 238000003058 natural language processing Methods 0.000 description 4
- 238000013461 design Methods 0.000 description 3
- 230000018109 developmental process Effects 0.000 description 3
- 238000012423 maintenance Methods 0.000 description 3
- 230000000977 initiatory effect Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000006386 memory function Effects 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/0706—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
- G06F11/0718—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in an object-oriented system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/079—Root cause analysis, i.e. error or fault diagnosis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Quality & Reliability (AREA)
- Computer Security & Cryptography (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The application discloses a conflict detection method, a device, electronic equipment and a storage medium, which relate to the technical field of computers and are used for realizing license conflict detection on open source software and dependent items, and the method comprises the following steps: firstly, determining any two licenses from a license set; then, judging whether conflict exists between any two licenses; if yes, stopping conflict detection and outputting license conflict prompt information; if not, continuing to determine any two other licenses from the license set, and performing conflict detection until the license conflict prompt information is obtained or the conflict detection of all the licenses in the license set is completed. By the method, license conflict detection on the open source software and the dependent items is realized, and the problem of license conflict caused by the fact that the license conflict detection on each dependent item is not carried out in the related technology is avoided.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and apparatus for detecting a collision, an electronic device, and a storage medium.
Background
Currently, open sources have become a major trend in software development. Typically, a software developer will select different open source licenses for the corresponding open source software to limit the usage conditions of the open source software, so as to limit the different rights and obligations of the open source software user.
Since the constraints of different open source licenses may be different, this may lead to compatibility problems between open source licenses, which should not occur in the same open source software, otherwise a license violation may be involved. However, software developers often do not know the conflicting relationship between open source licenses, resulting in many software developers initiating license conflicts when selecting an open source license.
In the related art, when open source license violation detection is performed, a method is mainly adopted to directly compare license regulations among different open source licenses. Illustratively, the license regulations corresponding to different open source licenses can be subjected to semantic analysis through natural language processing, grammar structures, semantic representations and the like capable of representing the different license regulations are analyzed from the different license regulations, and then whether conflicts exist among the open source licenses is judged by comparing the grammar semantics of the license regulations corresponding to the different open source licenses.
However, an open source software does not exist independently, and many dependent projects are also included in association with the open source software, that is, in the process of developing the open source software, resources such as databases, function modules and the like provided by a third party are used, so that the same open source software may call different dependent projects, and if a license conflict occurs on an open source license between different dependent projects, the license conflict on the open source license of the open source software may occur.
Disclosure of Invention
The embodiment of the application provides a conflict detection method, a device, electronic equipment and a storage medium, which are used for realizing the conflict detection of open source licenses among open source software and different dependent items thereof, and avoiding the problem of license conflicts caused by the fact that the compatible relation among the open source licenses of each dependent item is not paid attention to in the related technology.
In a first aspect, an embodiment of the present application provides a method for detecting a collision, where the method includes:
Any two licenses are determined from a license set, wherein the license set comprises a license corresponding to an item to be detected and a license corresponding to a dependent item of the item to be detected;
judging whether conflict exists between any two licenses;
if yes, stopping conflict detection and outputting license conflict prompt information;
if not, determining any two other licenses from the license set, and performing conflict detection until license conflict prompt information is obtained or conflict detection of all the licenses in the license set is completed.
In an alternative embodiment, determining any two licenses from the set of licenses includes:
Acquiring each dependent item corresponding to the item to be detected;
Based on the item to be detected and the dependent item corresponding to the item to be detected, constructing an item dependent network, wherein the item dependent network is used for describing the dependent relationship between the item to be detected and the dependent item;
Based on the project dependent network, a license set is obtained, and any two licenses are determined from the license set.
In an alternative embodiment, after continuing to determine any two other licenses from the license set, and performing conflict detection until license conflict prompt information is obtained or conflict detection on all the licenses in the license set is completed, the method further includes:
Storing the compatibility relation between any two licenses into a license compatibility relation map; the compatibility relationship between any two licenses has a transferable state that characterizes a first license of the any two licenses as being compatible with a second license, and the first license is also compatible with a third license other than the second license, or an undeliverable state that characterizes the first license as being compatible with only the second license.
In an alternative embodiment, determining whether there is a conflict between any two licenses includes:
respectively acquiring license regulations corresponding to each license in the license set;
Judging whether a target license exists based on license regulations; wherein, any two licenses have compatibility with the target license respectively, and the compatibility characterizes that the license regulations corresponding to the any two licenses do not conflict with the license regulations corresponding to the target license;
If yes, no conflict exists between any two licenses;
if not, then a conflict exists between any two licenses.
In an alternative embodiment, the method further comprises:
if the item to be detected does not comprise any dependent item, determining the item to be detected as a normal node in the item dependent network.
In an alternative embodiment, after completing conflict detection for all licenses in the set of licenses, further comprising:
If the license corresponding to the item to be detected and the license corresponding to each dependent item do not have conflict, and each dependent item is a normal node, the item to be detected is determined to be the normal node in the item dependent network.
In an alternative embodiment, after stopping the collision detection and outputting the license collision prompt information, the method further includes:
If the license corresponding to the item to be detected conflicts with the license corresponding to any one of the dependent items, determining the item to be detected as an illegal node in the item dependent network;
If the conflict exists between the licenses corresponding to any two dependent items of the item to be detected, determining the item to be detected as an infected node in the item dependent network, wherein the infected node represents that the conflict exists between all the dependent items related to the item to be detected.
In a second aspect, an embodiment of the present application provides a collision detection apparatus, including:
the determining module is used for determining any two licenses from a license set, wherein the license set comprises a license corresponding to an item to be detected and a license corresponding to a dependent item of the item to be detected;
the judging module is used for judging whether conflict exists between any two licenses;
the processing module is used for stopping conflict detection and outputting license conflict prompt information; or the method is used for continuously determining any two other licenses from the license set and performing conflict detection until the license conflict prompt information is obtained or the conflict detection of all the licenses in the license set is completed.
In an alternative embodiment, when any two licenses are determined from the set of licenses, the determining module is specifically configured to:
Acquiring each dependent item corresponding to the item to be detected;
constructing an item dependence network based on the item to be detected and a dependence item corresponding to the item to be detected, wherein the item dependence network is used for describing the dependence relationship between the item to be detected and the dependence item;
And obtaining the license set based on the project dependent network, and determining any two licenses from the license set.
In an alternative embodiment, after continuing to determine any two other licenses from the set of licenses and performing conflict detection until a license conflict prompt is obtained or conflict detection of all the licenses in the set of licenses is completed, the processing module is further configured to:
Storing the compatibility relation between any two licenses into a license compatibility relation map; the compatibility relationship between any two licenses has a transferable state that characterizes a first license of the any two licenses as being compatible with a second license, and the first license is also compatible with a third license other than the second license, or an undeliverable state that characterizes the first license as being compatible with only the second license.
In an alternative embodiment, in determining whether there is a conflict between any two licenses, the determining module is specifically configured to:
respectively acquiring license regulations corresponding to each license in the license set;
Judging whether a target license exists based on license regulations; wherein, any two licenses have compatibility with the target license respectively, and the compatibility characterizes that the license regulations corresponding to the any two licenses do not conflict with the license regulations corresponding to the target license;
If yes, no conflict exists between any two licenses;
if not, then a conflict exists between any two licenses.
In an alternative embodiment, the processing module is further configured to:
if the item to be detected does not comprise any dependent item, determining the item to be detected as a normal node in the item dependent network.
In an alternative embodiment, after completing the conflict detection for all licenses in the set of licenses, the processing module is further configured to:
If the license corresponding to the item to be detected and the license corresponding to each dependent item do not have conflict, and each dependent item is a normal node, the item to be detected is determined to be the normal node in the item dependent network.
In an alternative embodiment, after stopping the collision detection and outputting the license collision prompt information, the processing module is further configured to:
If the license corresponding to the item to be detected conflicts with the license corresponding to any one of the dependent items, determining the item to be detected as an illegal node in the item dependent network;
If the conflict exists between the licenses corresponding to any two dependent items of the item to be detected, determining the item to be detected as an infected node in the item dependent network, wherein the infected node represents that the conflict exists between all the dependent items related to the item to be detected.
In a third aspect, the present application provides an electronic device comprising a processor and a memory, wherein the memory stores program code that, when executed by the processor, causes the processor to perform the steps of the collision detection method of the first aspect described above.
In a fourth aspect, the present application provides a computer readable storage medium comprising program code for causing an electronic device to carry out the steps of the collision detection method of the first aspect described above, when said program code is run on the electronic device.
In a fifth aspect, the present application provides a computer program product which, when invoked by a computer, causes the computer to perform the steps of the collision detection method as described in the first aspect.
The application has the following beneficial effects:
In the conflict detection method provided by the embodiment of the application, firstly, any two licenses are determined from a license set; then, judging whether conflict exists between any two licenses; if yes, stopping conflict detection and outputting license conflict prompt information; if not, determining any two other licenses from the license set, and performing conflict detection until license conflict prompt information is obtained or conflict detection of all the licenses in the license set is completed. By the method, the conflict detection of the licenses of the items to be detected and the licenses depending on the items is realized, the problem that in the related art, the detection is not comprehensive enough due to the fact that only two independent items are subjected to the license conflict detection is avoided, the conflict detection of the licenses of different depending items is realized, and therefore, when the license conflict detection is carried out, a more accurate detection result can be obtained, and the condition that the undetected licenses have license conflicts is avoided.
Furthermore, other features and advantages of the application will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, it will be apparent that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art. In the drawings:
fig. 1 is a schematic flow chart of an implementation of a collision detection method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a license compatibility relationship according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a collision detecting device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the technical solutions of the present application, but not all embodiments. All other embodiments, based on the embodiments described in the present document, which can be obtained by a person skilled in the art without any creative effort, are within the scope of protection of the technical solutions of the present application.
In the description of the present application, "a plurality of" means "at least two". "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. A is connected with B, and can be represented as follows: both cases of direct connection of A and B and connection of A and B through C. In addition, in the description of the present application, the words "first," "second," and the like are used merely for distinguishing between the descriptions and not be construed as indicating or implying a relative importance or order.
In addition, in the technical scheme of the application, the data is collected, transmitted, used and the like, and all meet the requirements of national relevant laws and regulations.
The following briefly describes the design concept of the embodiment of the present application:
Currently, open sources have become a major trend in software development. But the development and use of open source software is also accompanied by a number of risks, of which the user is required to pay attention to the potential risk of indicating title. Typically, a software developer will select different open source licenses for the corresponding open source software to limit the usage conditions of the open source software, so as to limit the different rights and obligations of the open source software user.
Since the constraints of different open source licenses may be different, this may lead to compatibility problems between open source licenses, which should not occur in the same open source software, otherwise license violations may occur. However, software developers often do not know the conflicting relationship between open source licenses, resulting in many software developers initiating license conflicts when selecting an open source license.
In the related art, when open source license violation detection is performed, a method is mainly adopted to directly compare license regulations among different open source licenses. By way of example, the license regulations corresponding to different open source licenses may be semantically analyzed by natural speech processing, a syntax structure, a semantic representation, etc. capable of representing the different license regulations may be analyzed from the different license regulations, and then whether a conflict exists between the open source licenses may be determined by comparing the syntax semantics of the license regulations corresponding to the different open source licenses.
However, an open source software does not exist independently, and many dependent projects are also included in association with the open source software, that is, in the process of developing the open source software, resources such as databases, function modules and the like provided by a third party are used, so that the same open source software may call different dependent projects, and if there is a conflict between open source licenses of different dependent projects, the open source license of the open source software itself may be caused to have a license conflict.
In view of this, in order to avoid license conflicts occurring in licenses corresponding to each dependent item of open source software, an embodiment of the present application provides a conflict detection method, which specifically includes: firstly, determining any two licenses from a license set, wherein the licenses comprise licenses corresponding to an item to be detected and licenses corresponding to dependent items of the item to be detected; then, judging whether conflict exists between any two licenses; if yes, stopping conflict detection and outputting license conflict prompt information; if not, determining any two other licenses from the license set, and performing conflict detection until license conflict prompt information is obtained or conflict detection of all the licenses in the license set is completed.
By the method, conflict detection of the licenses of each dependent item is realized, and the problem that in the related technology, the license conflict occurs due to the fact that the conflict detection is only carried out on the licenses of different open source software is avoided.
The collision detection method provided by the exemplary embodiment of the present application is described below with reference to the accompanying drawings.
Referring to fig. 1, a schematic implementation flow chart of a collision detection method according to an embodiment of the present application is shown, where a specific implementation flow chart of the method is as follows:
S1: any two licenses are determined from the set of licenses.
The license set comprises a license corresponding to the item to be detected and a license corresponding to the dependent item of the item to be detected.
In an alternative embodiment, it is desirable to build an item dependent network when license conflict detection is performed. Specifically, in the embodiment of the present application, first, each dependent item corresponding to an item to be detected is acquired. By way of example, each dependent item corresponding to the item to be detected may be obtained by using a public data set, an official API, a crawler, and the like. For example, the dependent item B, the dependent item C, and the like corresponding to the item a to be detected can be obtained in the above manner, and the dependent item D, the dependent item E, and the like corresponding to the dependent item B can also be obtained. It can be understood that, when each dependent item corresponding to the item to be detected is acquired, each dependent item corresponding to the item to be detected and each dependent item corresponding to each dependent item can be acquired in a recursive manner.
Therefore, in the embodiment of the application, the conflict detection method provided by the embodiment of the application can be used for detecting the compatibility relationship between the license of the open source software and the license of the dependent item and also can be used for detecting the compatibility relationship between the license of the dependent item and the license of other dependent items.
Further, after each dependent item corresponding to the item to be detected is obtained, an item dependent network is built based on the item to be detected and the dependent item corresponding to the item to be detected.
In the embodiment of the application, the project dependent network is used for describing the dependency relationship between the project to be detected and the dependent project.
Illustratively, when building the project dependent network, each project is taken as a node and the dependency relationships between the projects are taken as edges. When the item dependency network is constructed, the dependency relationship between the item to be detected and each dependent item is subjected to semantic transformation, for example, the dependent item a is added as a dependency to the item a to be detected. And utilizing the directed graph to represent the dependency relationship between the item to be detected and each dependent item. Specifically, the vertex of the directed graph is used as an item to be detected, the edge of the directed graph is used as the dependency relationship between the item to be detected and the dependent item, and the edge set is the set of all the dependent items of the item to be detected. Thus, in building an item-dependent network, the item to be detected will have a directed edge pointing to the dependent item. By the method, when the project dependent network is constructed, the project to be detected and the license of each dependent project can be constrained downwards, and the constraint relation of the license can flow along the arrow direction.
Still further, after the project-dependent network is built, a set of licenses is obtained based on the project-dependent network, and any two licenses are determined from the set of licenses.
In the embodiment of the application, if whether the license of the item to be detected is different from the license of other dependent items needs to be detected, a license set formed by the item to be detected and the corresponding licenses of the dependent items can be obtained through the item dependent network; then, any two licenses are determined from the license set. For example, if the license set includes the license a, the license B, and the license C …, any two licenses, such as the license a and the license D, are determined from the license set, and then collision detection is performed on the license a and the license D.
By the above method, it is possible to construct an item-dependent network representing the dependency relationship between the item to be detected and each dependent item, and obtain a license set including the item to be detected and each license of each dependent item from the item-dependent network.
S2: it is determined whether there is a conflict between any two licenses.
In the embodiment of the application, after any two licenses are determined from the license set, whether conflict exists between any two licenses can be judged. If there is a conflict between any two licenses, step S3 is executed, and if there is no conflict between any two licenses, step S4 is executed.
In an alternative embodiment, after any two licenses are determined, license regulations corresponding to each license in the license set are respectively acquired.
Specifically, license regulations for the entire contents of each license may be processed through natural language processing (Natural Language Processing, NLP), such as sentence processing, word segmentation processing, and the like. Then, based on the processed license regulations, it is determined whether or not a target license exists in the license set. It should be noted that, how to process the license regulations of the license is a relatively conventional technical means in the prior art, and the embodiments of the present application are not specifically described herein.
It is noted that in the embodiment of the present application, any two licenses have compatibility with a target license, and the compatibility characterizes that the license regulations corresponding to any two licenses do not conflict with the license regulations corresponding to the target license.
If any two licenses have compatibility with the target license respectively, no conflict exists between any two licenses. For example, if there is a license a that is compatible with the target license B and a license C that is also compatible with the target license B, then it is stated that there is no conflict between license a and license C.
If at least one of the two arbitrary licenses has no compatibility with the target license, then a conflict exists between the two arbitrary licenses. For example, license a is compatible with target license B, but license C is not compatible with target license B, then a conflict between license a and license C is declared. As another example, if neither license a nor license C is compatible with the target license B, then there is a conflict between license a and license C.
S3: and stopping conflict detection and outputting license conflict prompt information.
In the embodiment of the application, if the conflict exists between any two licenses, the conflict detection is stopped, and the license conflict prompt information is output.
When the conflict exists between any two licenses, the conflict detection is stopped, and license conflict prompt information can be output to operation and maintenance personnel, so that the operation and maintenance personnel can know nodes with the license conflict in the project dependent network, and relevant processing is carried out.
S4: and determining any two other licenses from the license set, and performing conflict detection until license conflict prompt information is obtained or conflict detection of all the licenses in the license set is completed.
In the embodiment of the application, if no conflict exists between any two licenses selected from the license set for the first time, the other any two licenses are determined from the license set continuously, and conflict detection is performed. Illustratively, when any two licenses determined from the license set for the first time are license a and license B, respectively, then any other two licenses, e.g., license a and license C or license C and license D, may be determined from the license set next time. If any other two licenses are detected to have conflict, license conflict prompt information is obtained, and if any other two licenses are not in conflict, the two licenses are continuously selected for conflict detection until the conflict detection of all the licenses in the license set is completed.
In an alternative embodiment, the compatibility relationship between any two licenses can also be saved to a license compatibility relationship map.
In the embodiment of the present application, the compatible relationship between any two licenses has a transferable state, and it should be noted that the transferable state indicates that a first license in any two licenses is compatible with a second license, and the first license is also compatible with a third license other than the second license, or the compatible relationship between any two licenses has an undeliverable state, and the undeliverable state indicates that the first license in any two licenses is compatible with only the second license.
Referring to fig. 2, for example, a license a of any two licenses is compatible with a license B, there is a compatible relationship between the license a and the license B, the license a is directed to the license B by a solid arrow in the license compatible relationship map, and the license B is compatible with a license C, the license B is directed to the license C by a solid arrow in the license compatible relationship map, and when the license a is compatible with the license C, and the compatible relationship between the license a and the license B has a transferable state, the license a is directed to the license B by a solid arrow in the license compatible relationship map, and the license B is directed to the license C by a solid arrow in the license compatible relationship map.
For another example, if license a of any two licenses is compatible with license B, then license a points to license B with a solid arrow in the license compatibility relationship map; license B is compatible with license D, but license a is not compatible with license D, then license B points to license D with a dashed arrow in the license compatibility relationship graph, indicating that the compatibility relationship between license a and license B has an undeliverable state, license a is compatible with only license B, license B is compatible with license D, and license a is not compatible with license D.
By the method, the compatible relation between the licenses is distinguished between the transmissible state and the undeliverable state, so that the situation that in the related technology, when the license A is compatible with the license B, the license B is compatible with the license C and the license A is not compatible with the license C, the license A is erroneously detected to be compatible with the license C through the license B is avoided, and therefore the accuracy of conflict detection is improved.
In an alternative embodiment, if the item to be detected does not include any dependent items, the item to be detected is determined to be a normal node in the item dependent network.
Specifically, when the project dependent network is constructed, it may be determined whether each project includes a dependent project. For example, if the item to be detected is open source software or a dependent item corresponding to the open source software, when the open source software does not include the dependent item or the dependent item does not include other dependent items, the item to be detected is determined to be a normal node, and a license of the item to be detected does not conflict with a license of other dependent items.
In an alternative embodiment, after the conflict detection of all the licenses in the license set is completed, if the license corresponding to the item to be detected has no conflict with the license corresponding to each dependent item, and each dependent item is a normal node, determining the item to be detected as the normal node in the item dependent network.
For example, the item to be detected includes a dependent item a, a dependent item B, and a dependent item C, and if the license corresponding to the item to be detected does not conflict with the license corresponding to each of the dependent item a, the dependent item B, and the dependent item C, and the dependent item a, the dependent item B, and the dependent item C do not include other dependent items, the item to be detected is determined as a normal node in the item dependent network.
In an alternative embodiment, after stopping the conflict detection and outputting the license conflict prompt information, if the license corresponding to the item to be detected conflicts with the license corresponding to any one of the dependent items, determining the item to be detected as an illegal node in the item dependent network.
For example, if the license corresponding to the item to be detected conflicts with the license corresponding to the dependent item B, the item to be detected is determined as the offending node. The conflict item to be detected is determined to be the illegal node, so that the position of the illegal item can be accurately positioned, and the illegal item can be conveniently handled by operation and maintenance personnel.
Further, if there is a conflict between the licenses corresponding to any two dependent items of the item to be detected, determining the item to be detected as an infected node in the item dependent network.
It should be noted that, there is a conflict between the infected node characterizing all the dependent items related to the item to be detected.
By the method, when conflict exists between any two licenses corresponding to the dependent items and corresponding to the items to be detected, the items to be detected are directly determined to be the infected nodes, the characteristics of other licenses are affected according to the rule violation of the licenses, subsequent detection is not needed, and the time required by detection is shortened.
Further, based on the same technical concept, the embodiment of the application provides a conflict detection device, which is used for realizing the above-mentioned method flow of the embodiment of the application. Referring to fig. 3, the apparatus includes: a determining module 301, a judging module 302 and a processing module 303,
The determining module 301 is configured to determine any two licenses from a license set, where the license set includes a license corresponding to an item to be detected and a license corresponding to a dependent item of the item to be detected;
A judging module 302, configured to judge whether a conflict exists between any two licenses;
a processing module 303, configured to stop collision detection and output license collision prompt information; or the method is used for continuously determining any two other licenses from the license set and performing conflict detection until the license conflict prompt information is obtained or the conflict detection of all the licenses in the license set is completed.
In an alternative embodiment, when any two licenses are determined from the set of licenses, the determining module 301 is specifically configured to:
Acquiring each dependent item corresponding to the item to be detected;
constructing an item dependence network based on the item to be detected and a dependence item corresponding to the item to be detected, wherein the item dependence network is used for describing the dependence relationship between the item to be detected and the dependence item;
And obtaining the license set based on the project dependent network, and determining any two licenses from the license set.
In an alternative embodiment, after continuing to determine any two other licenses from the license set and performing conflict detection until the license conflict prompt is obtained or the conflict detection of all the licenses in the license set is completed, the processing module 303 is further configured to:
Storing the compatibility relation between any two licenses into a license compatibility relation map; the compatibility relationship between any two licenses has a transferable state that characterizes a first license of the any two licenses as being compatible with a second license, and the first license is also compatible with a third license other than the second license, or an undeliverable state that characterizes the first license as being compatible with only the second license.
In an alternative embodiment, in determining whether there is a conflict between any two licenses, the determining module 302 is specifically configured to:
respectively acquiring license regulations corresponding to each license in the license set;
Judging whether a target license exists based on license regulations; wherein, any two licenses have compatibility with the target license respectively, and the compatibility characterizes that the license regulations corresponding to the any two licenses do not conflict with the license regulations corresponding to the target license;
If yes, no conflict exists between any two licenses;
if not, then a conflict exists between any two licenses.
In an alternative embodiment, the processing module 303 is further configured to:
if the item to be detected does not comprise any dependent item, determining the item to be detected as a normal node in the item dependent network.
In an alternative embodiment, after completing the conflict detection for all licenses in the set of licenses, the processing module 303 is further configured to:
If the license corresponding to the item to be detected and the license corresponding to each dependent item do not have conflict, and each dependent item is a normal node, the item to be detected is determined to be the normal node in the item dependent network.
In an alternative embodiment, after stopping the conflict detection and outputting the license conflict prompt, the processing module 303 is further configured to:
If the license corresponding to the item to be detected conflicts with the license corresponding to any one of the dependent items, determining the item to be detected as an illegal node in the item dependent network;
If the conflict exists between the licenses corresponding to any two dependent items of the item to be detected, determining the item to be detected as an infected node in the item dependent network, wherein the infected node represents that the conflict exists between all the dependent items related to the item to be detected.
Based on the same technical concept, the embodiment of the application also provides electronic equipment, which can realize the conflict detection method flow provided by the embodiment of the application. In one embodiment, the electronic device may be a server, a terminal device, or other electronic device. Referring to fig. 4, the electronic device may include:
At least one processor 401, and a memory 402 connected to the at least one processor 401, in which the specific connection medium between the processor 401 and the memory 402 is not limited in the embodiment of the present application, and in fig. 4, the connection between the processor 401 and the memory 402 through the bus 400 is taken as an example. The bus 400 is shown in bold lines in fig. 4, and the manner in which the other components are connected is illustrated schematically and not by way of limitation. The bus 400 may be divided into an address bus, a data bus, a control bus, etc., and is represented by only one thick line in fig. 4 for ease of illustration, but does not represent only one bus or one type of bus. Or processor 401 may also be referred to as a controller, without limitation of the name.
In the embodiment of the present application, the memory 402 stores instructions executable by the at least one processor 401, and the at least one processor 401 may perform a collision detection method as described above by executing the instructions stored in the memory 402. Processor 401 may implement the functions of the various modules in the apparatus shown in fig. 3.
The processor 401 is a control center of the apparatus, and various interfaces and lines can be used to connect various parts of the entire control device, and by executing or executing instructions stored in the memory 402 and invoking data stored in the memory 402, various functions of the apparatus and processing data can be performed, so that the apparatus is monitored as a whole.
In one possible design, processor 401 may include one or more processing units, and processor 401 may integrate an application processor and a modem processor, wherein the application processor primarily processes operating systems, user interfaces, application programs, and the like, and the modem processor primarily processes wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 401. In some embodiments, processor 401 and memory 402 may be implemented on the same chip, and in some embodiments they may be implemented separately on separate chips.
The processor 401 may be a general purpose processor such as a CPU, digital signal processor, application specific integrated circuit, field programmable gate array or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, and may implement or perform the methods, steps and logic blocks disclosed in the embodiments of the present application. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of a conflict detection method disclosed in connection with the embodiments of the present application may be directly embodied as a hardware processor executing, or may be executed by a combination of hardware and software modules in the processor.
Memory 402 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The Memory 402 may include at least one type of storage medium, which may include, for example, flash Memory, hard disk, multimedia card, card Memory, random access Memory (Random Access Memory, RAM), static random access Memory (Static Random Access Memory, SRAM), programmable Read-Only Memory (Programmable Read Only Memory, PROM), read-Only Memory (ROM), charged erasable programmable Read-Only Memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only Memory, EEPROM), magnetic Memory, magnetic disk, optical disk, and the like. Memory 402 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 402 in embodiments of the present application may also be circuitry or any other device capable of performing memory functions for storing program instructions and/or data.
By programming the processor 401, the code corresponding to one of the frequency offset estimation methods described in the foregoing embodiments may be solidified into a chip, so that the chip can execute the steps of one of the conflict detection methods of the embodiment shown in fig. 2 at runtime. How to design and program the processor 401 is a technology well known to those skilled in the art, and will not be described in detail here.
Based on the same inventive concept, the embodiments of the present application also provide a storage medium storing computer instructions that, when executed on a computer, cause the computer to perform a collision detection method as previously discussed.
In some possible embodiments, the application also provides that aspects of a collision detection method may also be implemented in the form of a program product comprising program code for causing the control apparatus to carry out the steps of a collision detection method according to the various exemplary embodiments of the application as described in the specification, when the program product is run on a device.
It should be noted that although several units or sub-units of the apparatus are mentioned in the above detailed description, such a division is merely exemplary and not mandatory. Indeed, the features and functions of two or more of the elements described above may be embodied in one element in accordance with embodiments of the present application. Conversely, the features and functions of one unit described above may be further divided into a plurality of units to be embodied.
Furthermore, although the operations of the methods of the present application are depicted in the drawings in a particular order, this is not required or suggested that these operations must be performed in this particular order or that all of the illustrated operations must be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a server, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's equipment, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.
Claims (10)
1. A method of collision detection, the method comprising:
any two licenses are determined from a license set, wherein the license set comprises a license corresponding to an item to be detected and a license corresponding to a dependent item of the item to be detected;
judging whether conflict exists between any two licenses or not;
if yes, stopping conflict detection and outputting license conflict prompt information;
if not, determining any two other licenses from the license set, and performing conflict detection until license conflict prompt information is obtained or conflict detection of all the licenses in the license set is completed.
2. The method of claim 1, wherein determining any two licenses from the set of licenses comprises:
Acquiring each dependent item corresponding to the item to be detected;
constructing an item dependence network based on the item to be detected and a dependence item corresponding to the item to be detected, wherein the item dependence network is used for describing the dependence relationship between the item to be detected and the dependence item;
And obtaining the license set based on the project dependent network, and determining any two licenses from the license set.
3. The method of claim 1, further comprising, after said continuing to determine any other two licenses from said set of licenses, performing conflict detection until a license conflict hint is obtained or conflict detection is completed for all licenses in said set of licenses:
Storing the compatibility relation between any two licenses into a license compatibility relation map; the compatibility relationship between any two licenses has a transferable state that characterizes a first license of the any two licenses as being compatible with a second license and the first license as being compatible with a third license other than the second license, or an undeliverable state that characterizes the first license as being compatible with only the second license.
4. The method of claim 1, wherein said determining whether a conflict exists between any two licenses comprises:
Respectively acquiring license regulations corresponding to each license in the license set;
Judging whether a target license exists or not based on the license regulations; wherein, the two random licenses respectively have compatibility with the target license, and the compatibility characterizes that the license regulations corresponding to the two random licenses do not conflict with the license regulations corresponding to the target license;
If yes, no conflict exists between any two licenses;
If not, then a conflict exists between any two licenses.
5. The method of claim 2, wherein the method further comprises:
And if the item to be detected does not comprise any dependent item, determining the item to be detected as a normal node in the item dependent network.
6. The method of claim 2, further comprising, after said completing conflict detection for all licenses in the set of licenses:
if the license corresponding to the item to be detected does not conflict with the license corresponding to each dependent item, and each dependent item is a normal node, the item to be detected is determined to be a normal node in the item dependent network.
7. The method of claim 2, further comprising, after the stopping conflict detection and outputting a license conflict prompt:
If the license corresponding to the item to be detected conflicts with the license corresponding to any one of the dependent items, determining the item to be detected as an illegal node in the item dependent network;
If the license corresponding to any two dependent items of the item to be detected has a conflict, determining the item to be detected as an infected node in the item dependent network, wherein the infected node represents that all the dependent items related to the item to be detected have a conflict.
8. A collision detection apparatus, the apparatus comprising:
The determining module is used for determining any two licenses from a license set, wherein the license set comprises a license corresponding to an item to be detected and a license corresponding to a dependent item of the item to be detected;
the judging module is used for judging whether conflict exists between any two licenses;
The processing module is used for stopping conflict detection and outputting license conflict prompt information; or the method is used for continuously determining any two other licenses from the license set and performing conflict detection until license conflict prompt information is obtained or conflict detection of all the licenses in the license set is completed.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1-7 when executing the computer program.
10. A computer readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, implements the method according to any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410501361.8A CN118445102A (en) | 2024-04-24 | 2024-04-24 | Conflict detection method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410501361.8A CN118445102A (en) | 2024-04-24 | 2024-04-24 | Conflict detection method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118445102A true CN118445102A (en) | 2024-08-06 |
Family
ID=92327220
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410501361.8A Pending CN118445102A (en) | 2024-04-24 | 2024-04-24 | Conflict detection method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118445102A (en) |
-
2024
- 2024-04-24 CN CN202410501361.8A patent/CN118445102A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10423518B2 (en) | Systems and methods for analyzing violations of coding rules | |
US8539475B2 (en) | API backward compatibility checking | |
US8539593B2 (en) | Extraction of code level security specification | |
US12182269B2 (en) | Automatic generation of patches for security violations | |
US20070220493A1 (en) | Recording medium, software verification apparatus and software verification method | |
US11782813B2 (en) | Methods and apparatus to determine refined context for software bug detection and correction | |
US9091723B2 (en) | Concurrent test instrumentation | |
US20100131472A1 (en) | Detection and utilzation of inter-module dependencies | |
US20070022106A1 (en) | System design using a RAS-based database | |
CN110286912B (en) | Code detection method and device and electronic equipment | |
EP2199905A1 (en) | Lifecycle management and consistency checking of object models using application platform tools | |
US20090132692A1 (en) | System and method for starting server services | |
CN111258562B (en) | Java code quality inspection method, device, equipment and storage medium | |
Yamagata et al. | Runtime monitoring for concurrent systems | |
CN118445102A (en) | Conflict detection method and device, electronic equipment and storage medium | |
CN118152298A (en) | Memory access detection method and device, electronic equipment and computer storage medium | |
CN107562423B (en) | UI page development method and device | |
CN117950637A (en) | Method, device, electronic equipment and storage medium for serializing objects | |
CN113971019B (en) | Data type creation method, device, server and medium | |
Danmin et al. | A formal specification in B of an operating system | |
CN112559370A (en) | Front-end-based React project unit testing method and related equipment | |
CN112162776B (en) | Dependency acquisition method and device | |
Drechsler et al. | Automated and quality-driven requirements engineering | |
Simons et al. | Plug and play safely: Rules for behavioural compatibility | |
JPH05216721A (en) | Electronic computer |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |