Concurrent conflict detection method and device, equipment, medium and product
By determining the access status and target thread of the structure member during the operation of the target structure code, and using the number of threads and access time for concurrent conflict detection, the problem of insufficient detection accuracy and reliability in the prior art is solved, and more efficient and reliable concurrent conflict detection is achieved.
Patent Information
- Application Number
- CN202411814643.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-04
AI Technical Summary
When detecting concurrent conflicts, the prior art lacks accuracy and reliability, especially in complex multi-threaded scenarios, false alarms or missed reports are easily generated, resulting in low detection efficiency and high cost.
During the operation of the target structure code, the access status and target thread of the structure members are determined, and concurrent conflict detection is performed using the number of threads and access moments to improve the accuracy and reliability of the detection.
Improves the accuracy and reliability of concurrent conflict detection, reduces false alarms and missed alarms, reduces development and maintenance costs, and is suitable for high-performance production environments.
Smart Images

Figure CN119759600A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, specifically to technical fields such as C++ language, structure, multi-threaded programming, code detection, concurrency conflict and cloud computing, and more particularly to a concurrency conflict detection method, device, equipment, medium and product. Background Art
[0002] In the field of programming, ensuring the stability and correctness of code execution is a long-standing challenge. As a programming language widely used in high-performance computing, the complexity of C++ multi-threaded programming makes the detection and troubleshooting of concurrency conflicts particularly important.
[0003] Concurrency conflicts usually refer to when multiple threads or processes access shared resources at the same time without proper synchronization, which may lead to unpredictable results or incorrect behavior. This situation is particularly common in multi-threaded programming. Common concurrency conflicts include data competition and deadlock.
[0004] Traditional concurrency conflict detection is mostly based on code-level analysis and judgment to determine whether there is a concurrency conflict problem. Summary of the invention
[0005] The present disclosure provides a concurrency conflict detection method, apparatus, device, medium and product for improving the accuracy and reliability of concurrency conflict detection.
[0006] According to one aspect of the present disclosure, a method for detecting a concurrency conflict is provided, comprising:
[0007] During the execution of the target structure code to be detected, determining the access status of a first candidate structure member in the target structure code;
[0008] In the case that there is a second candidate structure member whose access status is being accessed among the first candidate structure members, determining a target thread that is accessing the second candidate structure member;
[0009] When the number of the target threads is at least two, a concurrency conflict detection is performed on the target structure code according to the target access time corresponding to the access of each target thread to the second candidate structure member.
[0010] According to another aspect of the present disclosure, a concurrent conflict detection device is provided, comprising:
[0011] An access status determination module, used to determine the access status of a first candidate structure member in the target structure code during the execution of the target structure code to be detected;
[0012] a target thread determination module, configured to determine a target thread that is accessing a second candidate structure member when there is a second candidate structure member whose access status is being accessed among the first candidate structure members;
[0013] The detection module is used to perform concurrency conflict detection on the target structure code according to the target access time corresponding to each target thread accessing the second candidate structure member when the number of the target threads is at least two.
[0014] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0015] at least one processor; and
[0016] a memory communicatively connected to at least one processor; wherein,
[0017] The memory stores instructions that can be executed by at least one processor. The instructions are executed by at least one processor to enable the at least one processor to perform any method in the present disclosure.
[0018] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute any one of the methods in the present disclosure.
[0019] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, and the computer program executes any one of the methods of the present disclosure when a processor is used.
[0020] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0022] Figure 1 is a flow chart of some concurrent conflict detection methods disclosed in the embodiments of the present disclosure;
[0023] Figure 2 is a flow chart of other concurrent conflict detection methods disclosed in embodiments of the present disclosure;
[0024] Figure 3 is a flow chart of other concurrent conflict detection methods disclosed in embodiments of the present disclosure;
[0025] Figure 4It is a structural schematic diagram of some concurrent conflict detection devices disclosed in the embodiments of the present disclosure;
[0026] Figure 5 The block diagram is a block diagram of an electronic device used to implement the concurrent conflict detection method disclosed in the embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0028] Traditional concurrency conflict detection is mostly based on code-level analysis and judgment to determine whether there is a concurrency conflict problem, usually including tool detection and manual detection.
[0029] Among them, tool detection includes but is not limited to using tools such as AddressSanitizer, ThreadSanitizer or static detection tools for concurrency conflict detection. However, current detection tools have limited detection capabilities for concurrency conflicts and are prone to false positives or missed positives in complex multi-threaded scenarios, resulting in insufficient detection accuracy and reliability.
[0030] Manual detection requires manual code review and unit test writing to detect concurrency conflicts. Not only can it not guarantee the accuracy and reliability of detection, it also leads to low detection efficiency and high labor costs.
[0031] Figure 1 This is a flowchart of some concurrency conflict detection methods disclosed in the embodiments of the present disclosure. This embodiment can be applied to the case where concurrency conflict detection is performed on structure code using the access time of a thread accessing a structure member. The method of this embodiment can be executed by the concurrency conflict detection device disclosed in the embodiments of the present disclosure. The device can be implemented in software and / or hardware and can be integrated in any electronic device with computing capabilities, such as a computer.
[0032] like Figure 1 As shown, the concurrency conflict detection method disclosed in this embodiment may include:
[0033] S101. During the execution of a target structure code to be detected, an access status of a first candidate structure member in the target structure code is determined.
[0034] Among them, the structure code refers to the code program obtained by compiling the code for the structure, that is, the code representation corresponding to the structure. The structure (also known as struct) is a data set consisting of a series of data of the same type or different types. It allows the user to combine different types of data to represent a single entity. The structure provides a convenient and flexible way to organize complex data. In the present embodiment, the target structure code refers to the structure code with parallel conflict detection requirements. The target structure code can be manually written by a technician, or it can be automatically written using a script or software tool.
[0035] Struct members refer to various variables or arrays defined in a structure, which are components of the structure, each member can store different types of data, and these structure members together constitute the data structure of the structure. Struct members include but are not limited to character arrays, integers, floating-point numbers, and other structures. In this embodiment, the first candidate structure member refers to the structure member included in the target structure code, and the number of the first candidate structure members is at least one.
[0036] When the target structure code is running, the first candidate structure member may be accessed through a structure variable or a structure pointer. According to whether the first candidate structure member is being accessed, the access status of the first candidate structure member is divided into "accessing status" and "not being accessed status". Among them, if the access status of any first candidate structure member is "accessing status", it means that the first candidate structure member is currently being accessed; if the access status of any first candidate structure member is "not being accessed status", it means that the first candidate structure member is not currently being accessed.
[0037] In one embodiment, a target structure code to be detected is obtained and the target structure code is run. In the target structure code, a corresponding first candidate access interface is pre-set for each first candidate structure member, and access to the first candidate structure member can be achieved by calling the first candidate access interface. During the running of the target structure code, an event listener is used to monitor in real time whether each first candidate access interface is called, and the access status of the corresponding first candidate structure member is determined according to whether each first candidate access interface is called.
[0038] Exemplarily, assuming that the event listener detects that the first candidate access interface A is called, the access status of the first candidate structure member A corresponding to the first candidate access interface A is determined to be in an accessing state; assuming that the event listener does not detect that the first candidate access interface A is called, the access status of the first candidate structure member A corresponding to the first candidate access interface A is determined to be in a not-accessed state.
[0039] In another embodiment, the target structure code to be detected is obtained and the target structure code is run. In the target structure code, a corresponding first candidate access interface is pre-set for each first candidate structure member, and access to the first candidate structure member can be achieved by calling the first candidate access interface. Information crawling is performed in the code running log corresponding to the target structure code to determine the calling status of each first candidate access interface recorded in the code running log.
[0040] Exemplarily, assuming that the code execution log records that the first candidate access interface A is called, the access status of the first candidate structure member A corresponding to the first candidate access interface A is determined to be in the accessing state; assuming that the code execution log does not record that the first candidate access interface A is called, the access status of the first candidate structure member A corresponding to the first candidate access interface A is determined to be in the not-accessed state.
[0041] S102: When there is a second candidate structure member whose access status is being accessed among the first candidate structure members, determine a target thread that is accessing the second candidate structure member.
[0042] Among them, a thread is the smallest unit that the operating system can perform operation scheduling. During the execution of the target structure code, each first candidate structure member may be accessed by at least one thread.
[0043] In one embodiment, if it is determined that the access status of each first candidate structure member is not accessed, the access status of each first candidate structure member continues to be determined in real time. If it is determined that the access status of any first candidate structure member is accessed, that is, there is at least one thread accessing the first candidate structure member, the first candidate structure member is used as the second candidate structure member, and information is crawled in the code execution log to determine at least one thread accessing the second candidate structure member as the target thread.
[0044] Exemplarily, assuming that the access status of the first candidate structure member B is determined to be the accessing status, the first candidate structure member B is used as the second candidate structure member, and information crawling is performed in the code execution log according to the identification information of the first candidate structure member B, and it is determined that the threads accessing the second candidate structure member (first candidate structure member B) are thread 1, thread 2, and thread 3, then thread 1, thread 2, and thread 3 are used as target threads.
[0045] S103: When the number of target threads is at least two, perform concurrency conflict detection on the target structure code according to the target access time corresponding to the access of each target thread to the second candidate structure member.
[0046] The target access time refers to the time corresponding to when each target thread accesses the second candidate structure member.
[0047] In one embodiment, the number of threads of the target thread is determined. If the number of threads of the target thread is one, that is, only one thread is accessing the second candidate structure member at this time, there is no concurrent access of multiple threads to the second candidate structure member, so there is no concurrency conflict problem, so it is determined that the target structure code does not have a concurrency conflict problem.
[0048] If the number of target threads is at least two, that is, at least two threads are accessing the second candidate structure member at this time, there is a situation where multiple threads are concurrently accessing the second candidate structure member. Therefore, it is necessary to determine whether there is a concurrency conflict problem based on the target access time corresponding to the access of each target thread to the second candidate structure member.
[0049] Specifically, information is crawled according to the identification information of each target thread in the code execution log, the target access time corresponding to the access of each target thread to the second candidate structure member is determined, the time interval is calculated according to each target access time, the time difference between each target access time is determined, and then each time difference is compared with the threshold value respectively. If any time difference is less than the threshold value, it is determined that there is a concurrency conflict in the concurrent access of multiple threads to the second candidate structure member, that is, it is determined that there is a concurrency conflict problem in the target structure code; if any time difference is greater than or equal to the threshold value, it is determined that there is no concurrency conflict in the concurrent access of multiple threads to the second candidate structure member, that is, it is determined that there is no concurrency conflict problem in the target structure code.
[0050] Exemplarily, it is assumed that the target threads include thread 1, thread 2 and thread 3, and the target access times corresponding to thread 1, thread 2 and thread 3 are "0 hours, 0 minutes, 200 milliseconds", "0 hours, 0 minutes, 350 milliseconds" and "0 hours, 0 minutes, 230 milliseconds", respectively, and the threshold is assumed to be "100 milliseconds". Since the time difference between thread 1 and thread 3 is 30 milliseconds, it is determined that there is a concurrency conflict problem in the target structure code.
[0051] The present disclosure determines the access status of a first candidate structure member in the target structure code during the running process of the target structure code to be detected; determines the target thread that is accessing the second candidate structure member when there is a second candidate structure member whose access status is being accessed in the first candidate structure member; and performs concurrent conflict detection on the target structure code according to the target access time corresponding to each target thread accessing the second candidate structure member when there are at least two target threads, and has the beneficial effects of:
[0052] First, unlike traditional concurrency conflict detection based on code-level analysis and judgment, the present invention utilizes log information generated during the running of structure code, such as threads that are accessing structure members and the time when threads access structure members, to perform concurrency conflict detection, which is more suitable for real-time detection of concurrency conflicts in multi-threaded scenarios, can reduce false positives or omissions in concurrency conflict detection in multi-threaded scenarios, improve the accuracy and reliability of concurrency conflict detection, and is conducive to improving the stability and correctness of structure code operation, and avoiding crashes in structure code operation.
[0053] Secondly, there is no need to manually review code and write unit tests to detect concurrency conflicts, which reduces the overall development and maintenance costs while improving the accuracy and reliability of detection.
[0054] Thirdly, the way traditional tools detect concurrency conflicts will insert a large amount of detection code when the code is running, resulting in a decrease in program performance. However, the present invention does not require the insertion of detection code. While improving detection accuracy, it has little impact on program performance. It is suitable for use in including but not limited to high-performance production environments, expanding the scope of application of concurrency conflict detection.
[0055] Figure 2 It is a flowchart of other concurrent conflict detection methods disclosed in the embodiments of the present disclosure, which can be used to further optimize and expand the above technical solution and can be combined with the above optional implementation methods.
[0056] like Figure 2 As shown, the concurrency conflict detection method disclosed in this embodiment may include:
[0057] S201 . During the execution of the target structure code to be detected, determine the first candidate access interfaces corresponding to the first candidate structure members.
[0058] Wherein, a corresponding first candidate access interface is pre-set for each first candidate structure member in the target structure code. By sending an access request to the first candidate access interface, access to the first candidate structure member corresponding to the first candidate access interface can be achieved.
[0059] In one implementation, an event listener is set in each first candidate access interface, and the event listener is used to monitor in real time whether each first candidate access interface receives an access request.
[0060] S202: Determine, from among the first candidate access interfaces, a second candidate access interface that has received an access request, and determine that an access status of a first candidate structure member corresponding to the second candidate access interface is an accessing status.
[0061] In one embodiment, if any first candidate access interface does not receive an access request, the access status of the first candidate structure member corresponding to the first candidate access interface is determined to be an unaccessed state; if any first candidate access interface receives an access request, the first candidate access interface is used as a second candidate access interface, and the access status of the first candidate structure member corresponding to the second candidate access interface is determined to be an accessing state.
[0062] Exemplarily, assuming that the first candidate structure member C corresponds to the first candidate access interface C, if the first candidate access interface C is monitored to receive an access request, the first candidate access interface C is used as the second candidate access interface, and the access status of the first candidate structure member C corresponding to the second candidate access interface (first candidate access interface C) is determined to be an accessing state; if the first candidate access interface C is not monitored to receive an access request, the access status of the first candidate structure member C is determined to be a non-accessed state.
[0063] By determining the first candidate access interface corresponding to each first candidate structure member respectively; determining the second candidate access interface that receives the access request in the first candidate access interface; and determining that the access status of the first candidate structure member corresponding to the second candidate access interface is the accessing status, since event monitoring is real-time, it is possible to promptly determine whether the first candidate access interface has received the access request, thereby improving the timeliness of determining the access status of the first candidate structure member and further improving the timeliness of concurrent conflict detection.
[0064] S203: When there is a second candidate structure member whose access status is being accessed in the first candidate structure members, determine a target code segment that is accessing the second candidate structure member from the target structure code.
[0065] The code segment is also called a text segment or an instruction segment, which contains the machine instructions of the program, that is, the executable program code. During the running of the target structure code, the code segment contained in the target structure code will access the second candidate structure member, so the code segment that is accessing the second candidate structure member is taken as the target code segment.
[0066] In one embodiment, if the access status of any first candidate structure member is in the accessing status, the first candidate structure member is used as the second candidate structure member. Information is crawled in the code execution log corresponding to the target structure code to determine the target code segment that is accessing the second candidate structure member.
[0067] S204: When the number of code segments of the target code segment is at least two, determine a target thread.
[0068] Among them, if only one code segment is accessing the second candidate structure member, there will usually be no concurrency conflict problem. Generally speaking, there are only at least two code segments accessing the second candidate structure member at the same time. Since the technician is not clear whether the two code segments are concurrent (i.e., different threads access the second candidate structure member at the same time), a concurrency conflict problem occurs.
[0069] In one embodiment, if the number of code segments of the target code segment is one, it is determined that there is no concurrency conflict problem in the target structure code; if the number of code segments of the target code segment is at least two, further analysis and judgment based on the access time of the thread is required, so the target thread that is accessing the second candidate structure member is determined.
[0070] Since concurrency conflicts usually do not occur when only one code segment is accessing the second candidate structure member, the target code segment that is accessing the second candidate structure member is determined from the target structure code; when the number of code segments of the target code segment is at least two, the target thread is determined, which can avoid subsequent meaningless analysis and calculation when the number of code segments of the target code segment is one, thereby improving the efficiency and real-time performance of concurrency conflict detection.
[0071] S205: When the number of target threads is at least two, determine the target access intention corresponding to each target thread accessing the second candidate structure member.
[0072] The target access intention reflects the target thread's intention to access the second candidate structure member, including the write data intention or the read data intention. The write data intention refers to the target thread accessing the second candidate structure member to perform a write data operation, and the read data intention refers to the target thread accessing the second candidate structure member to perform a read data operation.
[0073] In one embodiment, if the number of target threads is at least two, the target access intent corresponding to the target thread accessing the second candidate structure member is determined according to the type of the first candidate access interface receiving the access request. For example, assuming that the first candidate access interface receiving the access request is a read data interface, the target access intent is determined to be a write data intent; assuming that the first candidate access interface receiving the access request is a read data interface, the target access intent is determined to be a read data intent.
[0074] In another implementation, if the number of target threads is at least two, information is crawled in the code execution log corresponding to the target structure code to determine the target access intention corresponding to each target thread accessing the second candidate structure member.
[0075] Optionally, determining a target access intention corresponding to each target thread accessing a member of the second candidate structure includes:
[0076] A. Determine the target access interface corresponding to the second candidate structure member.
[0077] The target access interface includes a read data interface and a write data interface.
[0078] B. When any target thread accesses the second candidate structure member through the read data interface, the target access intent corresponding to the target thread is the read data intent.
[0079] C. When any target thread accesses the second candidate structure member through the write data interface, the target access intent corresponding to the target thread is the write data intent.
[0080] Exemplarily, assuming that the target thread 1 corresponds to a read data interface A1 and a write data interface A2, if the target thread 1 accesses the second candidate structure member through the read data interface A1, it is determined that the target access intention corresponding to the target thread 1 accessing the second candidate structure member is the read data intention; if the target thread 1 accesses the second candidate structure member through the write data interface A2, it is determined that the target access intention corresponding to the target thread 1 accessing the second candidate structure member is the write data interface.
[0081] By determining the target access interface corresponding to the second candidate structure member; wherein the target access interface includes a read data interface and a write data interface; when any target thread accesses the second candidate structure member through the read data interface, the target access intention corresponding to the target thread is a read data intention; when any target thread accesses the second candidate structure member through the write data interface, the target access intention corresponding to the target thread is a write data intention, thereby determining the target access intention by burying points in the target access interface, increasing the fine-grained perception capability of the use of the second candidate structure members, and improving the accuracy of determining the target access intention.
[0082] S206, determining the first thread whose target access intention is to write data in the target thread, and determining the first access time corresponding to each first thread in the target access time. S207, when the number of the first threads is at least two, determining the first time difference between each first access time, and performing concurrent write data conflict detection on the target structure code according to each first time difference.
[0083] In one embodiment, the number of threads of the first thread is determined. If the number of threads of the first thread is one, that is, at this time only one thread is accessing the second candidate structure member to perform a write data operation, there is no situation where multiple threads concurrently write data to the second candidate structure member, so there is no problem of concurrent write data conflict, so it is determined that the target structure code does not have the problem of concurrent write data conflict.
[0084] If the number of threads of the first thread is at least two, that is, at least two threads are accessing the second candidate structure member to perform data write operations, there is a situation where multiple threads concurrently write data to the second candidate structure member. Therefore, it is necessary to determine whether there is a concurrent data write conflict based on the first time difference between each first access time.
[0085] Specifically, information is crawled according to the identification information of each first thread in the code execution log, the first access time corresponding to the access of each first thread to the second candidate structure member is determined, the time interval is calculated according to each first access time, the first time difference between each first access time is determined, and then according to each first time difference, it is determined whether there is a concurrent data write conflict in the target structure code.
[0086] By determining the target access intention corresponding to each target thread accessing the second candidate structure member; determining the first thread whose target access intention is the write data intention among the target threads; determining the first access moment corresponding to each first thread in the target access moment; and determining the first moment difference between each first access moment when the number of threads of the first thread is at least two; and performing concurrent write data conflict detection on the target structure code according to each first moment difference, the accuracy and reliability of concurrent write data conflict detection are improved, which is beneficial to improving the stability and correctness of the structure code operation and avoiding crashes in the structure code operation.
[0087] Optionally, based on the first time difference values, concurrent writing data conflict detection is performed on the target structure code, including:
[0088] When the difference value at any first moment is less than the first threshold, it is determined that there is a concurrent write data conflict in the target structure code.
[0089] The first threshold value can be set and adjusted according to actual needs, and is used to determine whether there is a concurrent data writing conflict when each first thread concurrently writes data to the second candidate structure member.
[0090] In one embodiment, each first moment difference is compared with a first threshold value. If any first moment difference is greater than or equal to the first threshold value, it is determined that there is no concurrent write data conflict for concurrently writing data of the second candidate structure member by each first thread, that is, it is determined that there is no concurrent write data conflict problem in the target structure code; if any first moment difference is less than the first threshold value, it is determined that there is a concurrent write data conflict for concurrently writing data of the second candidate structure member by each first thread, that is, it is determined that there is a concurrent write data conflict problem in the target structure code.
[0091] Exemplarily, assuming that the first thread includes thread X and thread Y, the first access time corresponding to thread X is "0 hours, 0 minutes, 300 milliseconds", and the first access time corresponding to thread Y is "0 hours, 0 minutes, 350 milliseconds", then the first time difference is 50 milliseconds, and assuming that the first threshold is 100 milliseconds, it is determined that thread X and thread Y concurrently write data to the second candidate structure member and there is a concurrent write data conflict, that is, it is determined that the target structure code has a concurrent write data conflict problem.
[0092] By determining that there is a concurrent data write conflict in the target structure code when the difference value at any first moment is less than the first threshold, the beneficial effect is:
[0093] First, since the concept of threshold comparison is introduced when determining concurrent write data conflicts, a concurrent write data conflict will only be determined when the difference in access time between different threads is too small, thereby avoiding the false alarm problem of treating all concurrent write data operations as concurrent write data conflicts, thereby improving the accuracy of concurrent write data conflict detection.
[0094] Secondly, by detecting concurrent write data conflicts through threshold comparison, the efficiency and timeliness of concurrent write data conflict detection can be improved.
[0095] Thirdly, it meets the user's needs for detecting concurrent data writing conflicts, a specific concurrency conflict scenario.
[0096] Optionally, after determining that there is a concurrent data write conflict in the target structure code, the method further includes:
[0097] The target code position is determined from the target structure code; and the first type of prompt information is generated according to the target code position, wherein the first type of prompt information indicates to the user that there is a concurrent write data conflict at the target code position.
[0098] The target code position is the code position corresponding to the target code segment that is accessing the second candidate structure member. The target code position can be represented by the code file and code line number where the target code segment is located.
[0099] In one embodiment, information is crawled in the code execution log corresponding to the target structure code according to the identification information of the second candidate structure member, and the target code position corresponding to the target code segment that is accessing the second candidate structure member is determined. Further, a first type of prompt information is generated according to the target code position, and the first type of prompt information indicates that there is a concurrent write data conflict at the target code position. For example, "There is a concurrent write data conflict in the XX code line of the XX code file, please modify it immediately", etc.
[0100] By determining the target code position from the target structure code; generating a first type of prompt information according to the target code position, the first type of prompt information indicates that there is a concurrent write data conflict at the target code position, thereby achieving the effect of locating the concurrent write data conflict problem, which is conducive to prompting the user to repair the concurrent write data conflict problem in time, improving the stability and correctness of the structure code operation, and avoiding the crash of the structure code operation.
[0101] Figure 3 It is a flowchart of other concurrent conflict detection methods disclosed in the embodiments of the present disclosure, which can be used to further optimize and expand the above technical solution and can be combined with the above optional implementation methods.
[0102] like Figure 3 As shown, the concurrency conflict detection method disclosed in this embodiment may include:
[0103] S301 . During the execution of the target structure code to be detected, determine the access status of the first candidate structure member in the target structure code.
[0104] S302: When there is a second candidate structure member whose access status is being accessed in the first candidate structure members, determine a target thread that is accessing the second candidate structure member.
[0105] S303: Determine the target access intention corresponding to each target thread accessing the second candidate structure member.
[0106] S304, determine the first thread whose target access intention is to write data in the target thread; determine the first access time corresponding to each first thread in the target access time; determine the second thread whose target access intention is to read data in the target thread; determine the second access time corresponding to each second thread in the target access time.
[0107] S305 , determining a second time difference between each first access time and each second access time, and performing concurrent read-write data conflict detection on the target structure code according to each second time difference.
[0108] In one embodiment, information is crawled in the code execution log according to the identification information of each first thread and the identification information of each second thread to determine the first access time corresponding to the access of each first thread to the second candidate structure member, and the second access time corresponding to the access of each second thread to the second candidate structure member. The time interval is calculated according to each first access time and each second access time, and the second time difference between each first access time and each second access time is determined, and then according to each second time difference, it is determined whether there is a concurrent read and write data conflict in the target structure code.
[0109] By determining the second thread in the target thread whose target access intention is to read data; determining the second access moment corresponding to each second thread in the target access moment; determining the second moment difference between each first access moment and each second access moment; and performing concurrent read and write data conflict detection on the target structure code based on each second moment difference, the accuracy and reliability of concurrent read and write data conflict detection are improved, which is beneficial to improving the stability and correctness of the structure code operation and avoiding crashes in the structure code operation.
[0110] Optionally, based on the second time difference values, concurrent read and write data conflict detection is performed on the target structure code, including:
[0111] When the difference value at any second time is less than the second threshold, it is determined that there is a concurrent read-write data conflict in the target structure code.
[0112] The second threshold can be set and adjusted according to actual needs, and is used to determine whether there is a concurrent read and write data conflict when each first thread and each second thread concurrently read and write data to the second candidate structure member.
[0113] In one embodiment, each second-time difference is compared with a second threshold value. If any second-time difference is greater than or equal to the second threshold value, it is determined that there is no concurrent read-write data conflict between each first thread and each second thread in concurrently reading and writing data of the second candidate structure member, that is, it is determined that there is no concurrent read-write data conflict problem in the target structure code; if any second-time difference is less than the second threshold value, it is determined that there is a concurrent read-write data conflict between each first thread and each second thread in concurrently reading and writing data of the second candidate structure member, that is, it is determined that there is a concurrent read-write data conflict problem in the target structure code.
[0114] Exemplarily, assuming that the first thread includes thread X1 and thread Y1, the first access time corresponding to thread X1 is "0 hours, 0 minutes, 200 milliseconds", and the first access time corresponding to thread Y1 is "0 hours, 0 minutes, 300 milliseconds"; the second thread includes thread X2 and thread Y2, the second access time corresponding to thread X2 is "0 hours, 0 minutes, 370 milliseconds", and the second access time corresponding to thread Y2 is "0 hours, 0 minutes, 450 milliseconds", then the second time difference includes 170 milliseconds, 250 milliseconds, 70 milliseconds and 150 milliseconds. Assuming that the second threshold is 100 milliseconds, it is determined that there is a concurrent read and write data conflict between thread X2 and thread Y1 in concurrently reading and writing data of the second candidate structure member, that is, it is determined that there is a concurrent read and write data conflict problem in the target structure code.
[0115] By determining that there is a concurrent read-write data conflict in the target structure code when the difference value at any second moment is less than the second threshold, the beneficial effect is:
[0116] First, since the concept of threshold comparison is introduced when determining concurrent read and write data conflicts, a concurrent read and write data conflict will only be determined when the difference in access time between different threads is too small, thereby avoiding the false alarm problem of treating all concurrent read and write data operations as concurrent read and write data conflicts, thereby improving the accuracy of concurrent read and write data conflict detection.
[0117] Secondly, by detecting concurrent read and write data conflicts through threshold comparison, the efficiency and timeliness of concurrent read and write data conflict detection can be improved.
[0118] Thirdly, it meets the user's needs for detecting concurrent conflict scenarios, namely, conflicts in concurrent reading and writing of data.
[0119] Optionally, after determining that there is a concurrent read-write data conflict in the target structure code, the method further includes:
[0120] The target code position is determined from the target structure code; and the second type of prompt information is generated according to the target code position, the second type of prompt information indicating that there is a concurrent read and write data conflict at the target code position.
[0121] The target code position is the code position corresponding to the target code segment that is accessing the second candidate structure member. The target code position can be represented by the code file and code line number where the target code segment is located.
[0122] In one embodiment, information is crawled in the code execution log corresponding to the target structure code according to the identification information of the second candidate structure member, and the target code position corresponding to the target code segment that is accessing the second candidate structure member is determined. Further, a second type of prompt information is generated according to the target code position, and the second type of prompt information indicates that there is a concurrent read-write data conflict at the target code position. For example, "There is a concurrent read-write data conflict in the XX code line of the XX code file, please modify it immediately", etc.
[0123] By determining the target code location from the target structure code; generating a second type of prompt information based on the target code location, the second type of prompt information indicates that there is a concurrent read and write data conflict at the target code location, thereby achieving the effect of locating the concurrent read and write data conflict problem, which is beneficial to prompting the user to repair the concurrent read and write data conflict problem in time, improving the stability and correctness of the structure code operation, and avoiding crashes in the structure code operation.
[0124] Optionally, the method further includes:
[0125] 1) In response to receiving an editing operation on structure attribute information of a target structure in a configuration file to be edited, generating a target configuration file.
[0126] The configuration file to be edited includes an editing area for various types of structure attribute information, and the user can edit various types of structure attribute information in the editing area according to business needs. In response to the user's editing operation on the structure attribute information of the target structure, the edited configuration file to be edited is used as the target configuration file. The structure attribute information includes: at least one of a structure member, a structure field, and a structure inclusion relationship.
[0127] 2) Compile the target structure according to the code generation script and the target configuration file to generate the target structure code corresponding to the target structure.
[0128] The code generation script refers to a script that has the ability to automatically compile structure code, that is, it can automatically generate the target structure code according to the configured structure attribute information.
[0129] In one implementation, the target configuration file is used as input data of a code generation script, and the code generation script is executed to compile the target structure according to the target configuration file to generate a target structure code corresponding to the target structure.
[0130] By responding to receiving an editing operation on the structure attribute information of the target structure in the configuration file to be edited, a target configuration file is generated; the target structure is compiled according to the code generation script and the target configuration file to generate a target structure code corresponding to the target structure, thereby reducing manual coding errors, improving the structure code development efficiency and code quality, and making the adjustment of the structure attribute information more flexible, thereby reducing maintenance costs.
[0131] Figure 4 The present invention is a schematic diagram of a structure of some concurrency conflict detection devices disclosed in the embodiments of the present invention, which can be applied to the situation where concurrency conflict detection is performed on structure code by using the access time of a thread accessing a structure member. The device of this embodiment can be implemented by software and / or hardware, and can be integrated on any electronic device with computing capability.
[0132] like Figure 4 As shown, the concurrency conflict detection device 40 disclosed in this embodiment may include an access state determination module 41, a target thread determination module 42 and a detection module 43, wherein:
[0133] An access status determination module 41 is used to determine the access status of a first candidate structure member in the target structure code during the execution of the target structure code to be detected;
[0134] A target thread determination module 42 is used to determine a target thread that is accessing a second candidate structure member when there is a second candidate structure member whose access status is being accessed among the first candidate structure members;
[0135] The detection module 43 is used to perform concurrency conflict detection on the target structure code according to the target access time corresponding to each target thread accessing the second candidate structure member when the number of the target threads is at least two.
[0136] Optionally, the detection module 43 is specifically used to:
[0137] Determine a target access intention corresponding to each of the target threads accessing the second candidate structure member; wherein the target access intention includes a write data intention or a read data intention;
[0138] Determine a first thread in the target thread whose target access intention is the write data intention;
[0139] Determine a first access time corresponding to each of the first threads in the target access time;
[0140] When the number of the first threads is at least two, determining a first time difference between each of the first access times;
[0141] According to each of the first time differences, concurrent write data conflict detection is performed on the target structure code.
[0142] Optionally, the detection module 43 is further configured to:
[0143] Determine a second thread in the target thread whose target access intention is the data read intention;
[0144] Determine a second access time corresponding to each of the second threads in the target access time;
[0145] determining a second time difference between each of the first access times and each of the second access times;
[0146] According to each of the second time differences, concurrent read and write data conflict detection is performed on the target structure code.
[0147] Optionally, the detection module 43 is further configured to:
[0148] In the case where the difference value at any of the first moments is less than a first threshold, determining that a concurrent write data conflict exists in the target structure code;
[0149] In the case where the difference value at any of the second moments is less than the second threshold, it is determined that a concurrent read-write data conflict exists in the target structure code.
[0150] Optionally, the device further includes a target code segment determination module, specifically configured to:
[0151] Determine, from the target structure code, a target code segment that is accessing the second candidate structure member;
[0152] The target thread determination module 42 is specifically used for:
[0153] When the number of code segments of the target code segment is at least two, the target thread is determined.
[0154] Optionally, the device further includes a first prompt module, specifically configured to:
[0155] Determine a target code position from the target structure code; wherein the target code position is a code position corresponding to a target code segment that is accessing the second candidate structure member;
[0156] A first type of prompt information is generated according to the target code position, where the first type of prompt information indicates that a concurrent write data conflict exists at the target code position.
[0157] Optionally, the device further includes a second prompt module, specifically configured to:
[0158] Determine a target code position from the target structure code; wherein the target code position is a code position corresponding to a target code segment that is accessing the second candidate structure member;
[0159] A second type of prompt information is generated according to the target code position, where the second type of prompt information indicates that there is a concurrent read and write data conflict at the target code position.
[0160] Optionally, the access status determination module 41 is specifically configured to:
[0161] Determine first candidate access interfaces corresponding to the first candidate structure members respectively;
[0162] Determine, among the first candidate access interfaces, a second candidate access interface that receives an access request;
[0163] Determine that the access status of the first candidate structure member corresponding to the second candidate access interface is an accessing status.
[0164] Optionally, the detection module 43 is further configured to:
[0165] Determine a target access interface corresponding to the second candidate structure member; wherein the target access interface includes a read data interface and a write data interface;
[0166] In the case where any of the target threads accesses the second candidate structure member through the read data interface, the target access intent corresponding to the target thread is the read data intent;
[0167] When any of the target threads accesses the second candidate structure through the write data interface
[0168] In the case of a member, the target access intention corresponding to the target thread is the write data intention.
[0169] Optionally, the device further includes a structure code generation module, which is specifically used to:
[0170] In response to receiving an editing operation on structure attribute information of a target structure in a configuration file to be edited, generating a target configuration file; wherein the structure attribute information includes: at least one of a structure member, a structure field, and a structure inclusion relationship;
[0171] The target structure is compiled according to the code generation script and the target configuration file to generate the target structure code corresponding to the target structure. The concurrency conflict detection device 40 disclosed in the embodiment of the present disclosure can execute the concurrency conflict detection method disclosed in the embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method. The contents not described in detail in this embodiment can refer to the description in the embodiment of the method of the present disclosure.
[0172] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0173] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0174] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device 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 required herein.
[0175] like Figure 5 As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0176] A number of components in the device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0177] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 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 501 performs the various methods and processes described above, such as a method for detecting concurrent conflicts. For example, in some embodiments, the method for detecting concurrent conflicts may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of the method for detecting concurrent conflicts described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform a method for detecting concurrent conflicts in any other appropriate manner (e.g., by means of firmware).
[0178] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0179] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0180] In the context of the present disclosure, a machine-readable medium 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. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-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.
[0181] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0182] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0183] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0184] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0185] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A concurrent conflict detection method, comprising: During the execution of the target structure code to be detected, determining the access status of a first candidate structure member in the target structure code; In the case that there is a second candidate structure member whose access status is being accessed among the first candidate structure members, determining a target thread that is accessing the second candidate structure member; When the number of the target threads is at least two, a concurrency conflict detection is performed on the target structure code according to the target access time corresponding to the access of each target thread to the second candidate structure member.
2. The method according to claim 1, wherein: The performing concurrent conflict detection on the target structure code according to the target access time corresponding to each target thread accessing the second candidate structure member comprises: Determine a target access intention corresponding to each of the target threads accessing the second candidate structure member; wherein the target access intention includes a write data intention or a read data intention; Determine a first thread in the target thread whose target access intention is the write data intention; Determine a first access time corresponding to each of the first threads in the target access time; When the number of the first threads is at least two, determining a first time difference between each of the first access times; According to each of the first time differences, concurrent write data conflict detection is performed on the target structure code.
3. The method according to claim 2, after determining the target access intention corresponding to each of the target threads accessing the second candidate structure member, performing concurrent conflict detection on the target structure code according to the target access time corresponding to each of the target threads accessing the second candidate structure member, further comprising: Determine a second thread in the target thread whose target access intention is the data read intention; Determine a second access time corresponding to each of the second threads in the target access time; determining a second time difference between each of the first access times and each of the second access times; According to each of the second time differences, concurrent read and write data conflict detection is performed on the target structure code.
4. The method according to claim 3, wherein: The performing concurrent write data conflict detection on the target structure code according to each of the first time differences includes: In the case where the difference value at any of the first moments is less than a first threshold, determining that a concurrent write data conflict exists in the target structure code; The concurrent reading and writing data conflict detection is performed on the target structure code according to each second time difference, including: In the case where the difference value at any of the second moments is less than the second threshold, it is determined that a concurrent read-write data conflict exists in the target structure code.
5. The method according to claim 1, before determining the target thread accessing the second candidate structure member, the method further comprises: Determine, from the target structure code, a target code segment that is accessing the second candidate structure member; The determining of the target thread that is accessing the second candidate structure member includes: When the number of code segments of the target code segment is at least two, the target thread is determined.
6. The method according to claim 4, after determining that the target structure code has a concurrent write data conflict, the method further comprises: Determine a target code position from the target structure code; wherein the target code position is a code position corresponding to a target code segment that is accessing the second candidate structure member; A first type of prompt information is generated according to the target code position, where the first type of prompt information indicates that a concurrent write data conflict exists at the target code position.
7. The method according to claim 4, after determining that there is a concurrent read-write data conflict in the target structure code, the method further comprises: Determine a target code position from the target structure code; wherein the target code position is a code position corresponding to a target code segment that is accessing the second candidate structure member; A second type of prompt information is generated according to the target code position, where the second type of prompt information indicates that there is a concurrent read and write data conflict at the target code position.
8. The method according to claim 1, wherein: The step of determining the access status of a first candidate structure member in the target structure code includes: Determine first candidate access interfaces corresponding to the first candidate structure members respectively; Determine, among the first candidate access interfaces, a second candidate access interface that receives an access request; Determine that the access status of the first candidate structure member corresponding to the second candidate access interface is an accessing status.
9. The method according to claim 2, wherein: The determining of the target access intention corresponding to each target thread accessing the second candidate structure member includes: Determine a target access interface corresponding to the second candidate structure member; wherein the target access interface includes a read data interface and a write data interface; In the case where any of the target threads accesses the second candidate structure member through the read data interface, the target access intent corresponding to the target thread is the read data intent; When any of the target threads accesses the second candidate structure member through the write data interface, the target access intent corresponding to the target thread is the write data intent.
10. The method according to any one of claims 1 to 9, wherein: The method further comprises: In response to receiving an editing operation on structure attribute information of a target structure in a configuration file to be edited, generating a target configuration file; wherein the structure attribute information includes: at least one of a structure member, a structure field, and a structure inclusion relationship; The target structure is compiled according to the code generation script and the target configuration file to generate the target structure code corresponding to the target structure.
11. A concurrent conflict detection device, comprising: An access status determination module, used to determine the access status of a first candidate structure member in the target structure code during the execution of the target structure code to be detected; a target thread determination module, configured to determine a target thread that is accessing a second candidate structure member when there is a second candidate structure member whose access status is being accessed among the first candidate structure members; The detection module is used to perform concurrency conflict detection on the target structure code according to the target access time corresponding to each target thread accessing the second candidate structure member when the number of the target threads is at least two.
12. The device according to claim 11, wherein The detection module is specifically used for: Determine a target access intention corresponding to each of the target threads accessing the second candidate structure member; wherein the target access intention includes a write data intention or a read data intention; Determine a first thread in the target thread whose target access intention is the write data intention; Determine a first access time corresponding to each of the first threads in the target access time; When the number of the first threads is at least two, determining a first time difference between each of the first access times; According to each of the first time differences, concurrent write data conflict detection is performed on the target structure code.
13. The device according to claim 12, wherein the detection module is further configured to: Determine a second thread in the target thread whose target access intention is the data read intention; Determine a second access time corresponding to each of the second threads in the target access time; determining a second time difference between each of the first access times and each of the second access times; According to each of the second time differences, concurrent read and write data conflict detection is performed on the target structure code.
14. The device according to claim 13, wherein: The detection module is further specifically used for: In the case where the difference value at any of the first moments is less than a first threshold, determining that a concurrent write data conflict exists in the target structure code; In the case where the difference value at any of the second moments is less than the second threshold, it is determined that a concurrent read-write data conflict exists in the target structure code.
15. The device according to claim 11, further comprising a target code segment determination module, specifically configured to: Determine, from the target structure code, a target code segment that is accessing the second candidate structure member; The target thread determination module is specifically used for: When the number of code segments of the target code segment is at least two, the target thread is determined.
16. The device according to claim 14, further comprising a first prompting module, specifically configured to: Determine the target code location from the target structure code; wherein, The target code position is a code position corresponding to the target code segment that is accessing the second candidate structure member; A first type of prompt information is generated according to the target code position, where the first type of prompt information indicates that a concurrent write data conflict exists at the target code position.
17. The device according to claim 14, further comprising a second prompting module, specifically configured to: Determine the target code location from the target structure code; wherein, The target code position is a code position corresponding to the target code segment that is accessing the second candidate structure member; A second type of prompt information is generated according to the target code position, where the second type of prompt information indicates that there is a concurrent read and write data conflict at the target code position.
18. The device according to claim 11, wherein The access status determination module is specifically used to: Determine first candidate access interfaces corresponding to the first candidate structure members respectively; Determine, among the first candidate access interfaces, a second candidate access interface that receives an access request; Determine that the access status of the first candidate structure member corresponding to the second candidate access interface is an accessing status.
19. The device according to claim 12, wherein: The detection module is further specifically used for: Determine a target access interface corresponding to the second candidate structure member; wherein the target access interface includes a read data interface and a write data interface; In the case where any of the target threads accesses the second candidate structure member through the read data interface, the target access intent corresponding to the target thread is the read data intent; When any of the target threads accesses the second candidate structure member through the write data interface, the target access intent corresponding to the target thread is the write data intent.
20. The device according to any one of claims 11 to 19, wherein: The device also includes a structure code generation module, which is specifically used for: In response to receiving an editing operation on structure attribute information of a target structure in a configuration file to be edited, generating a target configuration file; wherein the structure attribute information includes: at least one of a structure member, a structure field, and a structure inclusion relationship; The target structure is compiled according to the code generation script and the target configuration file to generate the target structure code corresponding to the target structure.
21. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 10.
22. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-10.
23. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Software transaction internal memory implementing method based on delaying policy
CN101510162A
Multi-interrupt routine data access conflict detection method based on abstract interpretation
CN103778062A
Method and tool for detecting errors in thread access to shared resources in WSN program
CN110569191A
Internal concurrent I / O scheduling method and system for partitions of data server side
CN110837411A
Parallelization acceleration method of simulation model
CN117130891A