An OPC ecological matrix accelerator resource optimization method and application system
Patent Information
- Application Number
- CN202610789737.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-03
- Publication Date
- 2026-09-22
AI Technical Summary
[0002]目前,传统方法通常基于静态配置或简单轮询机制进行资源分配,无法解析OPCUA交互数据中的频率和时延特征,也不能对服务节点进行聚类和优先级划分,更缺少交互矩阵分块编码及并行匹配的能力
(1)本发明通过解析OPC UA交互数据提取交互频率和时延特征,结合历史日志对服务节点聚类并确定簇优先级,构建优化后的OPC生态交互矩阵并进行分块编码,将矩阵分块的特征向量与历史资源配置向量并行匹配,利用调度偏移量快速映射到硬件资源池,大幅减少了资源检索时间,提高了调度实时性和匹配精度;
Smart Images

Figure CN122802457A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of resource optimization technology, specifically to a resource optimization method and application system for an OPC ecosystem matrix accelerator. Background Technology
[0002] Currently, traditional methods typically allocate resources based on static configuration or simple polling mechanisms. These methods cannot analyze the frequency and latency characteristics of OPCUA interaction data, nor can they cluster and prioritize service nodes. Furthermore, they lack the ability to encode interaction matrices in blocks and perform parallel matching. This results in long resource retrieval times and slow scheduling responses, making it difficult to meet the high-dynamic, low-latency scheduling requirements of the industrial IoT edge.
[0003] Furthermore, traditional methods often employ a holistic allocation approach, failing to split resources according to preset resource granularity and unable to collaboratively acquire resources from adjacent blocks, resulting in severe resource fragmentation. Simultaneously, the lack of bitmap detection and automatic merging mechanisms for idle resource regions prevents effective reduction of fragmentation. In resource contention scenarios, the absence of state locking and rapid reallocation processes after release easily leads to resource conflicts and waste, reducing the overall throughput and long-term operational reliability of accelerator execution nodes. Summary of the Invention
[0004] To achieve the above objectives, the present invention provides the following technical solution: a resource optimization method for an OPC ecosystem matrix accelerator, comprising: Receive resource scheduling requests from target OPC service nodes, where the target OPC service node can be any node among several OPC service nodes; parse the OPC UA interaction data corresponding to the resource scheduling request, and extract interaction frequency features and interaction latency features based on the OPC UA interaction data to determine the interaction relationship feature vector corresponding to the OPC UA interaction data; Based on the interaction relationship feature vector and the historical interaction logs collected between several OPC service nodes, several OPC service nodes are clustered to obtain several OPC service node clusters, and the cluster priority information corresponding to several OPC service node clusters is determined. Cluster priority information is associated and stored in the corresponding matrix elements of the OPC ecosystem interaction matrix to obtain the optimized OPC ecosystem interaction matrix, and the optimized OPC ecosystem interaction matrix is divided into several matrix blocks. Several matrices are divided into blocks and encoded into first interactive feature vectors. The first interactive feature vectors are then matched in parallel with the second interactive feature vectors in the historical resource configuration matrix stored in the accelerator to obtain matching information. Based on the resource scheduling tag information in the matching information, the scheduling offset is determined, and several matrix blocks are mapped to the hardware resource pools of several accelerator execution nodes according to the scheduling offset to obtain several target resource allocation schemes. The resource mapping information in the target resource allocation scheme is returned to the target OPC service node so that the target OPC service node can determine the accelerator execution node corresponding to the target resource allocation scheme based on the resource mapping information. If the data processing task of the target OPC service node meets the preset acceleration conditions, the data processing task is sent to the corresponding accelerator execution node based on the resource mapping information so that the accelerator execution node can execute the data processing task.
[0005] Preferably, before receiving the resource scheduling request from the target OPC service node, the method further includes: Time window slicing is performed on the historical interaction logs between several OPC service nodes to obtain several time window log segments; The interaction frequency characteristics and interaction latency characteristics are calculated based on several time window log segments, and the current resource scheduling density is determined. The matrix clustering parameters are set based on the resource scheduling density. The optimized OPC ecosystem interaction matrix is divided into blocks based on the matrix clustering parameters and the preset resource granularity, so that the optimized OPC ecosystem interaction matrix is divided into several corresponding matrix blocks. Among them, some OPC service nodes are OPC UA service nodes deployed at the edge of the industrial Internet of Things.
[0006] Preferably, several matrix blocks are mapped to hardware resource pools of several accelerator execution nodes to obtain several target resource allocation schemes, including: The computational requirements of the data processing task are matched with several matrix blocks to determine the target matrix block that matches the computational requirements. Determine whether there are any idle accelerator resources in the target matrix block that meet the computational requirements. If there are idle accelerator resources that meet the computational requirements, then extract the target accelerator resources that meet the computational requirements from the idle accelerator resources based on the preset resource granularity. If there are no available accelerator resources in the target matrix block that meet the computational requirements, then the target accelerator resources that meet the computational requirements are determined based on the adjacent matrix blocks of the target matrix block.
[0007] Preferably, the target accelerator resources that meet the computational requirements are extracted from idle accelerator resources based on a preset resource granularity, including: Extract target resource units that meet the computational requirements from the target matrix blocks, and perform granular alignment and splitting of the target resource units by preset resource granularity to obtain several split resource units; Extract target free resources that meet the computational requirements from several split resource units, and use the target free resources as target accelerator resources.
[0008] Preferably, if there are no idle accelerator resources in the target matrix block that meet the computational requirements, then the target accelerator resources that meet the computational requirements are determined based on the adjacent matrix blocks of the target matrix block, including: If there are no available accelerator resources in the target matrix block that meet the computational requirements, then the next matrix block adjacent to the target matrix block is taken as the current target matrix block, and the process jumps to the step of determining whether there are available available accelerator resources in the target matrix block that meet the computational requirements, so as to obtain the target accelerator resources. If the target accelerator resource is not obtained, the previous matrix block adjacent to the target matrix block is taken as the current target matrix block, and the process jumps to the step of determining whether there is an idle accelerator resource in the target matrix block that meets the computational requirements, so as to obtain the target accelerator resource.
[0009] Preferably, if the data processing task of the target OPC service node meets the preset acceleration conditions, the data processing task is distributed to the corresponding accelerator execution node based on the resource mapping information, so that the accelerator execution node can execute the data processing task, including: If the resource mapping information indicates that the data processing task corresponds to a single accelerator execution node, and the data processing task meets the preset acceleration conditions, then the physical resource address of the target accelerator execution node is determined based on the accelerator execution node identifier and scheduling offset in the resource mapping information. The data processing task is sent to the target accelerator execution node corresponding to the target OPC service node through the physical resource address, so that the target accelerator execution node can execute the data processing task; The resource mapping information includes the accelerator execution node identifier corresponding to each matrix block, the hardware resource usage of each matrix block, and the scheduling offset.
[0010] Preferably, if the data processing task of the target OPC service node meets the preset acceleration conditions, the data processing task is distributed to the corresponding accelerator execution node based on the resource mapping information so that the accelerator execution node can execute the data processing task. This also includes: If the resource mapping information represents the multi-accelerator execution node collaborative mode corresponding to the data processing task, then create a target task description file and save the scheduling offset in the resource mapping information as a collaborative offset to the private field of the target task description file. If the data processing task meets the preset acceleration conditions, the collaborative offset in the private field is loaded into the execution context of the data processing task, and the physical resource address corresponding to the target accelerator resource is found through the collaborative offset, so that the data processing task can be executed in parallel on multiple accelerator execution nodes based on the physical resource address.
[0011] Preferably, the method further includes: Record the target starting matrix coordinates of the resource region to be released in several target resource allocation schemes, as well as the target ending matrix coordinates after granular alignment of the resource region to be released. The occupancy status of the resource unit corresponding to the target starting matrix coordinates is detected by a preset resource bitmap. If it is free, the end matrix coordinates that are the same as the target starting matrix coordinates are found, and the first resource area to be merged and the resource area to be released corresponding to the end matrix coordinates are merged to obtain the first merged area. The system detects the occupancy status of resource units corresponding to the target end matrix coordinates using a preset resource bitmap. If the resource unit is free, it searches for the starting matrix coordinates that are the same as the target end matrix coordinates and merges the second resource region to be merged with the resource region to be released to obtain the second merged region.
[0012] Preferably, the method further includes: If the target accelerator resource is currently occupied, and a resource request for the target accelerator resource is received from a resource contention node among several OPC service nodes, the target accelerator resource will be set to an unavailable state through a preset interface, and the resource unschedulable information will be fed back to the resource contention node; the resource contention node is an OPC service node that is different from the target OPC service node. If the target accelerator resource has been released, the target accelerator resource will be set to an available state through a preset interface; If another request for target accelerator resources is received from a resource-contention node, the target accelerator resources will be allocated to the resource-contention node.
[0013] An OPC ecosystem matrix accelerator resource optimization application system, applicable to the aforementioned OPC ecosystem matrix accelerator resource optimization method, includes: The feature extraction module is configured to receive resource scheduling requests from a target OPC service node, which can be any node among several OPC service nodes; parse the OPC UA interaction data corresponding to the resource scheduling request, and extract interaction frequency features and interaction latency features based on the OPC UA interaction data to determine the interaction relationship feature vector corresponding to the OPC UA interaction data. The node clustering module is configured to cluster several OPC service nodes based on interaction relationship feature vectors and historical interaction logs collected between several OPC service nodes, so as to obtain several OPC service node clusters and determine the cluster priority information corresponding to several OPC service node clusters. The matrix partitioning module is configured to associate and store cluster priority information with the corresponding matrix elements of the OPC ecosystem interaction matrix to obtain the optimized OPC ecosystem interaction matrix, and then divide the optimized OPC ecosystem interaction matrix into several matrix blocks. The feature matching module is configured to encode several matrices into blocks as first interactive feature vectors, and to perform parallel matching between the first interactive feature vectors and the second interactive feature vectors in the historical resource configuration matrix stored in the accelerator to obtain matching information. The block mapping module is configured to determine the scheduling offset based on the resource scheduling tag information in the matching information, and to map several matrices to the hardware resource pools of several accelerator execution nodes according to the scheduling offset, so as to obtain several target resource allocation schemes. The resource optimization module is configured to return the resource mapping information in the target resource allocation scheme to the target OPC service node, so that the target OPC service node can determine the accelerator execution node corresponding to the target resource allocation scheme based on the resource mapping information. If the data processing task of the target OPC service node meets the preset acceleration conditions, the data processing task is sent to the corresponding accelerator execution node based on the resource mapping information so that the accelerator execution node can execute the data processing task.
[0014] Compared with the prior art, the beneficial effects of the present invention are: (1) This invention extracts interaction frequency and latency features by parsing OPC UA interaction data, clusters service nodes and determines cluster priority by combining historical logs, constructs an optimized OPC ecosystem interaction matrix and performs block encoding, matches the feature vectors of the matrix blocks with the historical resource configuration vectors in parallel, and uses scheduling offsets to quickly map to the hardware resource pool, which greatly reduces resource retrieval time and improves scheduling real-time performance and matching accuracy. (2) This invention splits resources into blocks or adjacent blocks of the target matrix according to preset resource granularity based on computational requirements, supporting single-node and multi-node collaborative modes. It automatically merges adjacent idle resource areas by detecting the start and end coordinates of the resource bitmap, reducing fragmentation. Simultaneously, it implements resource contention management, ensuring that occupied resources are unschedulable and readily available after release. This mechanism effectively avoids resource conflicts and waste, improving the overall throughput and long-term operational reliability of the accelerator execution nodes. Attached Figure Description
[0015] Figure 1This is a schematic flowchart of the overall method in one embodiment of the present invention; Figure 2 This is a schematic diagram of the overall system architecture in one embodiment of the present invention.
[0016] In the diagram: 1. Feature extraction module; 2. Node clustering module; 3. Matrix partitioning module; 4. Feature matching module; 5. Block mapping module; 6. Resource optimization module. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] Example 1, please refer to Figure 1 This invention provides a technical solution: a resource optimization method for an OPC ecosystem matrix accelerator, comprising: S1. Receive the resource scheduling request from the target OPC service node, which can be any node among several OPC service nodes; parse the OPC UA interaction data corresponding to the resource scheduling request, and extract the interaction frequency features and interaction delay features based on the OPC UA interaction data to determine the interaction relationship feature vector corresponding to the OPC UA interaction data. S2. Based on the interaction relationship feature vector and the historical interaction logs collected between several OPC service nodes, the several OPC service nodes are clustered to obtain several OPC service node clusters, and the cluster priority information corresponding to the several OPC service node clusters is determined. S3. Associatively store the cluster priority information into the corresponding matrix elements of the OPC ecosystem interaction matrix to obtain the optimized OPC ecosystem interaction matrix, and divide the optimized OPC ecosystem interaction matrix into several matrix blocks; S4. Encode several matrices into first interactive feature vectors in blocks, and perform parallel matching between the first interactive feature vectors and the second interactive feature vectors in the historical resource configuration matrix stored in the accelerator to obtain matching information. S5. Determine the scheduling offset based on the resource scheduling tag information in the matching information, and map several matrix blocks to the hardware resource pool of several accelerator execution nodes according to the scheduling offset to obtain several target resource allocation schemes. S6. Return the resource mapping information in the target resource allocation scheme to the target OPC service node so that the target OPC service node can determine the accelerator execution node corresponding to the target resource allocation scheme based on the resource mapping information. If the data processing task of the target OPC service node meets the preset acceleration conditions, then the data processing task is sent to the corresponding accelerator execution node based on the resource mapping information so that the accelerator execution node can execute the data processing task.
[0019] It should be noted that under the industrial internet platform, multiple OPC service nodes are connected to different production lines; the target OPC service node A sends a request to the resource scheduler, which includes OPC UA interaction data with the host computer, such as reading temperature variables 10 times per second and writing control commands once every 5 seconds; the parsed interaction frequency characteristics are high-frequency reading and low-frequency writing; the interaction latency characteristics are an average reading latency of 5 milliseconds and an average writing latency of 8 milliseconds, forming an interaction relationship feature vector [0.8, 0.3]. The scheduler combines historical interaction logs between all OPC service nodes over the past 30 days. For example, if node A has a lot of data exchange with B but less with C, it uses a clustering algorithm to divide the nodes into three clusters: Cluster 1 contains A, B, and E; Cluster 2 contains C and D; and Cluster 3 contains F and G. Cluster 1 has a priority of level 1 due to its frequent interactions and high real-time requirements; Cluster 2 has a priority of level 2; and Cluster 3 has a priority of level 3. Cluster priority information is stored in the OPC ecosystem interaction matrix. For example, matrix element [1,2] corresponds to the interaction priority 1 between nodes A and B. The optimized matrix is divided into 4×4 matrix blocks. Each block is encoded as a first interaction feature vector. For example, the vector for block 1 is [0.9,0.4,0.7]. The historical resource configuration matrix stored in the accelerator has multiple second interaction feature vectors. The entry with the highest similarity is found through parallel matching to obtain matching information. The resource scheduling tag information indicates the use of a dynamic resource allocation strategy. Based on the marking information, the scheduling offset is determined to be 3, which means the current resource pool is offset by 3 indices. The matrix is divided into blocks and mapped to the hardware resource pools of the three accelerator execution nodes: block 1 is mapped to execution node X, block 2 is mapped to node Y, and block 3 is mapped to node Z, forming the target resource allocation scheme. The resource mapping information in the scheme (such as node X address, number of cores, memory size) is returned to node A. Node A determines that the current data processing task is real-time temperature anomaly detection, which requires low latency and meets preset acceleration conditions (e.g., CPU utilization > 80%). Therefore, it sends the task to the corresponding accelerator execution node X. Node X executes the task and returns the result, completing resource optimization scheduling.
[0020] In an optional embodiment, before receiving the resource scheduling request from the target OPC service node, the method further includes: Time window slicing is performed on the historical interaction logs between several OPC service nodes to obtain several time window log segments; The interaction frequency characteristics and interaction latency characteristics are calculated based on several time window log segments, and the current resource scheduling density is determined. The matrix clustering parameters are set based on the resource scheduling density. The optimized OPC ecosystem interaction matrix is divided into blocks based on the matrix clustering parameters and the preset resource granularity, so that the optimized OPC ecosystem interaction matrix is divided into several corresponding matrix blocks. Among them, some OPC service nodes are OPC UA service nodes deployed at the edge of the industrial Internet of Things.
[0021] It should be noted that 10 OPCs are deployed at the industrial IoT edge. The UA service nodes each connect to different field devices. First, historical interaction logs from the past week are sliced into time windows, one window every 10 minutes, resulting in 1008 window segments. For each segment, the interaction frequency characteristics between nodes are calculated; for example, nodes A and B exchange 120 messages within the window, with an average response time of 8 milliseconds. Combining all windows, the current resource scheduling density is calculated to be an average of 1500 interactions per 10 minutes. Matrix clustering parameters are set based on this density; for example, the clustering radius is set to 0.3 for high density and 0.5 for low density. Then, the preset resource granularity is 4×4 for each matrix block. Based on the clustering parameters and resource granularity, the previously optimized OPC ecosystem interaction matrix is divided into blocks; for example, a 16×16 matrix is divided into several 4×4 matrix blocks, each corresponding to a resource scheduling unit. These 10 OPC service nodes are all actual devices deployed at the edge, such as production line PLCs and gateways. Subsequent resource scheduling requests will be matched in parallel based on these blocks.
[0022] In an optional embodiment, several matrix blocks are mapped to hardware resource pools of several accelerator execution nodes to obtain several target resource allocation schemes, including: The computational requirements of the data processing task are matched with several matrix blocks to determine the target matrix block that matches the computational requirements. Determine whether there are any idle accelerator resources in the target matrix block that meet the computational requirements. If there are idle accelerator resources that meet the computational requirements, then extract the target accelerator resources that meet the computational requirements from the idle accelerator resources based on the preset resource granularity. If there are no available accelerator resources in the target matrix block that meet the computational requirements, then the target accelerator resources that meet the computational requirements are determined based on the adjacent matrix blocks of the target matrix block.
[0023] It should be noted that the OPC ecosystem matrix accelerator needs to allocate resources for a data processing task; the computational requirements of this task are 3 computing cores and 8GB of memory; firstly, based on the computational requirements, it is matched with several matrix blocks, and it is found that the computational characteristics of the historical tasks corresponding to matrix block B are similar to those of the current task, so block B is determined as the target matrix block; Query the hardware resource pool status of accelerator execution node Y mapped to block B; the current node Y has a total of 16 cores and 64GB of memory, of which 10 cores and 40GB of memory are occupied by assigned tasks, and the idle resources are 6 cores and 24GB of memory; since the idle resources meet the requirement of 3 cores and 8GB, directly split 3 cores and 8GB of memory from the idle resources according to the preset resource granularity (e.g., 1 core and 2GB is a minimum granularity) and allocate them as target accelerator resources to the current task; In another scenario: node Y corresponding to block B has only 2 cores and 6GB of free resources, which does not meet the requirements; then search for matrix blocks A and C adjacent to block B; node X corresponding to block A has 4 cores and 12GB of free resources, and node Z corresponding to block C has 1 core and 4GB of free resources; select node X, and split 3 cores and 8GB of free resources from it as the target accelerator resources; at the same time, update the free resources of node X to 1 core and 4GB; finally, return the resource mapping information to the target OPC service node.
[0024] In an optional embodiment, the process of allocating target accelerator resources that meet computational requirements from idle accelerator resources based on a preset resource granularity includes: Extract target resource units that meet the computational requirements from the target matrix blocks, and perform granular alignment and splitting of the target resource units by preset resource granularity to obtain several split resource units; Extract target free resources that meet the computational requirements from several split resource units, and use the target free resources as target accelerator resources.
[0025] It should be noted that the hardware resource pool of the accelerator node is preset to contain 1 CPU core and 2GB of memory per resource unit; there are currently 6 resource units available, corresponding to 6 cores and 12GB of memory; the computational requirement of a data processing task is 3 cores and 6GB of memory, which means 3 resource units are needed. From the idle resources corresponding to the target matrix blocks, extract three consecutive resource units at the resource granularity, such as units A, B, and C; each unit contains 1 core and 2GB of memory; use these units as the split resource units; since the task requirement is exactly 3 units, directly use these 3 units as the target idle resources, i.e., the target accelerator resources. If the free resources are not in integer multiples, for example, if the free resources are 3 cores and 5GB of memory, but the task requires 3 cores and 6GB of memory, then they cannot be allocated and will be searched for adjacent blocks of resources; if the resource granularity is finer, for example, each unit is 0.5 cores and 1GB, then the task needs 6 units, and 6 consecutive units will be split from the free resources and allocated to the task. After the split is completed, the idle resource pool is updated, and the allocated resource units are subtracted; for example, if there are 1 to 6 idle units before allocation, after allocating 1 to 3 tasks, the idle units become 4 to 6, which is equivalent to 3 cores and 6GB of memory.
[0026] In an optional embodiment, if there are no idle accelerator resources in the target matrix block that meet the computational requirements, then the target accelerator resources that meet the computational requirements are determined based on the adjacent matrix blocks of the target matrix block, including: If there are no available accelerator resources in the target matrix block that meet the computational requirements, then the next matrix block adjacent to the target matrix block is taken as the current target matrix block, and the process jumps to the step of determining whether there are available available accelerator resources in the target matrix block that meet the computational requirements, so as to obtain the target accelerator resources. If the target accelerator resource is not obtained, the previous matrix block adjacent to the target matrix block is taken as the current target matrix block, and the process jumps to the step of determining whether there is an idle accelerator resource in the target matrix block that meets the computational requirements, so as to obtain the target accelerator resource.
[0027] It should be noted that in the OPC ecosystem matrix accelerator, the current target matrix block is block B. It was detected that the idle resources of the accelerator execution node Y corresponding to block B are only 2 cores and 4GB of memory, while the current data processing task requires 4 cores and 8GB of memory, which does not meet the requirements. Therefore, the next block C adjacent to the target matrix block is taken as the new target matrix block. The node Z corresponding to block C has 5 cores and 10GB of memory available, which meets the requirements. 4 cores and 8GB of memory are allocated from node Z to the task, thus obtaining the target accelerator resources. If the next block C also lacks sufficient resources, for example, only 3 cores and 6GB of memory are available, it still does not meet the requirements; then it moves to the previous block A adjacent to the target matrix block; the node X corresponding to block A has 4 cores and 8GB of memory available, which meets the requirements, so it is allocated; if there are no sufficient resources in the adjacent blocks above and below, the search range continues to be expanded according to preset rules, such as the next block or the previous block, until a resource node that meets the requirements is found; this mechanism ensures the robustness of resource allocation.
[0028] In an optional embodiment, if the data processing task of the target OPC service node meets the preset acceleration conditions, the data processing task is distributed to the corresponding accelerator execution node based on the resource mapping information, so that the accelerator execution node can execute the data processing task, including: If the resource mapping information indicates that the data processing task corresponds to a single accelerator execution node, and the data processing task meets the preset acceleration conditions, then the physical resource address of the target accelerator execution node is determined based on the accelerator execution node identifier and scheduling offset in the resource mapping information. The data processing task is sent to the target accelerator execution node corresponding to the target OPC service node through the physical resource address, so that the target accelerator execution node can execute the data processing task; The resource mapping information includes the accelerator execution node identifier corresponding to each matrix block, the hardware resource usage of each matrix block, and the scheduling offset.
[0029] It should be noted that the data processing task of OPC service node A is to perform real-time filtering on data from 1000 sensors, requiring 4 cores and 8GB of memory. After resource scheduling, resource mapping information is generated, which includes: the accelerator execution node corresponding to matrix block B is identified as node Y, the hardware resource usage is 4 cores and 8GB of memory, and the scheduling offset is 3. Node A determines that the task meets the preset acceleration conditions, such as CPU utilization consistently exceeding 80% and the task being latency-sensitive. Since the resource mapping information shows that the task corresponds to a single accelerator execution node Y, node A calculates the physical resource address of the target accelerator execution node based on the identifier Y and the scheduling offset 3. For example, the offset 3 means offsetting 3 resource units from the starting address of node Y's hardware resource pool. Each resource unit corresponds to 1 core and 2GB of memory, so the physical address is the memory base address of node Y plus the offset. Node A directly sends the data processing task to the specified hardware resource of node Y through this physical address. Node Y performs the filtering calculation and returns the result to node A after completion. The entire process achieves a precise mapping from the task to a specific accelerator resource.
[0030] In an optional embodiment, if the data processing task of the target OPC service node meets the preset acceleration conditions, the data processing task is distributed to the corresponding accelerator execution node based on the resource mapping information so that the accelerator execution node can execute the data processing task. The method further includes: If the resource mapping information represents the multi-accelerator execution node collaborative mode corresponding to the data processing task, then create a target task description file and save the scheduling offset in the resource mapping information as a collaborative offset to the private field of the target task description file. If the data processing task meets the preset acceleration conditions, the collaborative offset in the private field is loaded into the execution context of the data processing task, and the physical resource address corresponding to the target accelerator resource is found through the collaborative offset, so that the data processing task can be executed in parallel on multiple accelerator execution nodes based on the physical resource address.
[0031] It should be noted that the data processing task of OPC service node A is a large matrix multiplication, requiring 16 cores and 32GB of memory. After resource scheduling, resource mapping information is generated, which indicates the multi-accelerator execution node collaborative mode corresponding to the task. The resource mapping information includes: matrix block B corresponds to node Y with 8 cores and 16GB of memory, with a scheduling offset of 2; matrix block C corresponds to node Z with 8 cores and 16GB of memory, with a scheduling offset of 5. Node A determines that the task meets the preset acceleration conditions, so it creates a target task description file in JSON format, containing the task ID, task type, data source address, and calculation result callback address. At the same time, the two scheduling offsets 2 and 5 from the resource mapping information are saved as collaborative offsets in the target task description file. In the file's private fields, the private fields are stored as an array [2,5]. Subsequently, node A loads the task description file and loads the collaborative offsets in the private fields into the execution context of the data processing task. In the execution context, the collaborative offsets are mapped to the physical resource addresses of nodes Y and Z respectively: node Y offsets 2 resource units from the starting address of its hardware resource pool based on the offset of 2, with each unit containing 1 core and 2GB of memory, to obtain the actual physical address; the same applies to node Z. Based on these two physical addresses, the task divides the matrix into two sub-blocks and distributes them to nodes Y and Z for parallel execution. After each node completes its calculation, it returns the results to node A for merging, and finally outputs the task result. This collaborative mode fully utilizes the parallel computing capabilities of multiple accelerators.
[0032] In an optional embodiment, the method further includes: Record the target starting matrix coordinates of the resource region to be released in several target resource allocation schemes, as well as the target ending matrix coordinates after granular alignment of the resource region to be released. The occupancy status of the resource unit corresponding to the target starting matrix coordinates is detected by a preset resource bitmap. If it is free, the end matrix coordinates that are the same as the target starting matrix coordinates are found, and the first resource area to be merged and the resource area to be released corresponding to the end matrix coordinates are merged to obtain the first merged area. The system detects the occupancy status of resource units corresponding to the target end matrix coordinates using a preset resource bitmap. If the resource unit is free, it searches for the starting matrix coordinates that are the same as the target end matrix coordinates and merges the second resource region to be merged with the resource region to be released to obtain the second merged region.
[0033] It should be noted that in the OPC Ecosystem Matrix Accelerator, the resource manager maintains a preset resource bitmap. Each bit of the bitmap represents a resource unit, and the resource units are arranged according to matrix coordinates. When a data processing task is completed and resources are released, the target starting matrix coordinates of the resource area to be released are recorded as row 3, column 4, and the target ending matrix coordinates are recorded as row 3, column 7, which is four consecutive resource units in a row. The system detects the occupancy status of the resource unit corresponding to the 3rd row and 4th column of the target's starting coordinates using a preset resource bitmap. If this position in the bitmap is read as 0, it indicates that the resource is idle. The system then searches for the ending matrix coordinates that match the target's starting coordinates, i.e., whether there exists a released region whose ending coordinates are also at the 3rd row and 4th column. A query of the resource reclamation records reveals a region A to be merged, with its starting coordinates at the 3rd row and 1st column and its ending coordinates at the 3rd row and 3rd column, which are adjacent to the current starting coordinates. Region A is merged with the current region to be released to obtain the first merged region, covering the 3rd row and 1st column to the 3rd row and 7th column. The resource bitmap is used to detect the occupancy status of the resource unit corresponding to the 3rd row and 7th column of the target's end coordinates; this position is 0, indicating it is free. The starting matrix coordinates that are the same as the target's end coordinates are searched to see if there is another released region whose starting coordinates are also the 3rd row and 7th column. Region B is found to have a starting coordinate of the 3rd row and 8th column and an end coordinate of the 3rd row and 10th column, which is adjacent to the current end coordinates. Region B is then merged with the first merged region to obtain the second merged region, covering the 3rd row and 1st column to the 3rd row and 10th column. The resource bitmap is marked as free in rows 3 and columns 1 to 10, forming a large free block that can be used for subsequent task allocation; if a resource unit at a certain boundary position is occupied, merging stops and the original fragments are retained; this mechanism effectively reduces resource fragmentation and improves resource utilization.
[0034] In an optional embodiment, the method further includes: If the target accelerator resource is currently occupied, and a resource request for the target accelerator resource is received from a resource contention node among several OPC service nodes, the target accelerator resource will be set to an unavailable state through a preset interface, and the resource unschedulable information will be fed back to the resource contention node; the resource contention node is an OPC service node that is different from the target OPC service node. If the target accelerator resource has been released, the target accelerator resource will be set to an available state through a preset interface; If another request for target accelerator resources is received from a resource-contention node, the target accelerator resources will be allocated to the resource-contention node.
[0035] It should be noted that in the Industrial Internet of Things (IIoT), OPC service node A is using an accelerator to execute a resource unit of node Y, which is already occupied. At this time, another OPC service node B (a resource contention node) sends a request for the target resource, requesting to acquire the same resource unit. Node A changes the status of the resource unit from available to unavailable through a preset interface and sends a resource unschedulable message to node B, indicating that the resource is already occupied. Upon receiving the message, node B enters a waiting queue. After a period of time, node A completes its task and releases the resource unit. Node A updates the resource status to available through a preset interface. At this point, node B sends the same resource request again. Detecting that the resource has been released, node A immediately allocates the resource to node B and updates the resource bitmap. After acquiring the resource, node B begins executing its task. This process avoids resource conflicts through state control, ensuring the orderly scheduling.
[0036] Example 2, please refer to Figure 2 This invention provides a technical solution: an OPC ecosystem matrix accelerator resource optimization application system, which is applicable to the aforementioned OPC ecosystem matrix accelerator resource optimization method, comprising: Feature extraction module 1 is configured to receive resource scheduling requests from a target OPC service node, where the target OPC service node is any node among several OPC service nodes; parse the OPC UA interaction data corresponding to the resource scheduling request, and extract interaction frequency features and interaction latency features based on the OPC UA interaction data to determine the interaction relationship feature vector corresponding to the OPC UA interaction data. The node clustering module 2 is configured to cluster several OPC service nodes based on the interaction relationship feature vector and the historical interaction logs collected between several OPC service nodes, so as to obtain several OPC service node clusters and determine the cluster priority information corresponding to several OPC service node clusters. Matrix partitioning module 3 is configured to associate and store cluster priority information into the corresponding matrix elements of the OPC ecosystem interaction matrix to obtain the optimized OPC ecosystem interaction matrix, and to divide the optimized OPC ecosystem interaction matrix into several matrix blocks; Feature matching module 4 is configured to encode several matrices into blocks as first interactive feature vectors, and perform parallel matching between the first interactive feature vectors and the second interactive feature vectors in the historical resource configuration matrix stored in the accelerator to obtain matching information. The block mapping module 5 is configured to determine the scheduling offset based on the resource scheduling tag information in the matching information, and to map several matrices to the hardware resource pool of several accelerator execution nodes according to the scheduling offset, so as to obtain several target resource allocation schemes. Resource optimization module 6 is configured to return the resource mapping information in the target resource allocation scheme to the target OPC service node, so that the target OPC service node can determine the accelerator execution node corresponding to the target resource allocation scheme based on the resource mapping information. If the data processing task of the target OPC service node meets the preset acceleration conditions, the data processing task is sent to the corresponding accelerator execution node based on the resource mapping information so that the accelerator execution node can execute the data processing task.
[0037] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited thereto. Various changes can be made within the scope of knowledge possessed by those skilled in the art without departing from the spirit of the present invention.
Claims
1. A resource optimization method for an OPC ecosystem matrix accelerator, characterized in that, include: Receive resource scheduling requests from the target OPC service node, which can be any one of several OPC service nodes; Parse the OPC UA interaction data corresponding to the resource scheduling request, and extract the interaction frequency features and interaction latency features based on the OPC UA interaction data to determine the interaction relationship feature vector corresponding to the OPC UA interaction data; Based on the interaction relationship feature vector and the historical interaction logs collected between several OPC service nodes, several OPC service nodes are clustered to obtain several OPC service node clusters, and the cluster priority information corresponding to several OPC service node clusters is determined. Cluster priority information is associated and stored in the corresponding matrix elements of the OPC ecosystem interaction matrix to obtain the optimized OPC ecosystem interaction matrix, and the optimized OPC ecosystem interaction matrix is divided into several matrix blocks. Several matrices are divided into blocks and encoded into first interactive feature vectors. The first interactive feature vectors are then matched in parallel with the second interactive feature vectors in the historical resource configuration matrix stored in the accelerator to obtain matching information. Based on the resource scheduling tag information in the matching information, the scheduling offset is determined, and several matrix blocks are mapped to the hardware resource pools of several accelerator execution nodes according to the scheduling offset to obtain several target resource allocation schemes. The resource mapping information in the target resource allocation scheme is returned to the target OPC service node so that the target OPC service node can determine the accelerator execution node corresponding to the target resource allocation scheme based on the resource mapping information. If the data processing task of the target OPC service node meets the preset acceleration conditions, the data processing task is sent to the corresponding accelerator execution node based on the resource mapping information so that the accelerator execution node can execute the data processing task.
2. The resource optimization method for an OPC ecosystem matrix accelerator according to claim 1, characterized in that, Before receiving the resource scheduling request from the target OPC service node, the method further includes: Time window slicing is performed on the historical interaction logs between several OPC service nodes to obtain several time window log segments; The interaction frequency characteristics and interaction latency characteristics are calculated based on several time window log segments, and the current resource scheduling density is determined. The matrix clustering parameters are set based on the resource scheduling density. The optimized OPC ecosystem interaction matrix is divided into blocks based on the matrix clustering parameters and the preset resource granularity, so that the optimized OPC ecosystem interaction matrix is divided into several corresponding matrix blocks. Among them, some OPC service nodes are OPC UA service nodes deployed at the edge of the industrial Internet of Things.
3. The resource optimization method for an OPC ecosystem matrix accelerator according to claim 2, characterized in that, Several matrix blocks are mapped to hardware resource pools of several accelerator execution nodes to obtain several target resource allocation schemes, including: The computational requirements of the data processing task are matched with several matrix blocks to determine the target matrix block that matches the computational requirements. Determine whether there are any idle accelerator resources in the target matrix block that meet the computational requirements. If there are idle accelerator resources that meet the computational requirements, then extract the target accelerator resources that meet the computational requirements from the idle accelerator resources based on the preset resource granularity. If there are no available accelerator resources in the target matrix block that meet the computational requirements, then the target accelerator resources that meet the computational requirements are determined based on the adjacent matrix blocks of the target matrix block.
4. The resource optimization method for an OPC ecosystem matrix accelerator according to claim 3, characterized in that, Based on a preset resource granularity, target accelerator resources that meet the computational requirements are extracted from idle accelerator resources, including: Extract target resource units that meet the computational requirements from the target matrix blocks, and perform granular alignment and splitting of the target resource units by preset resource granularity to obtain several split resource units; Extract target free resources that meet the computational requirements from several split resource units, and use the target free resources as target accelerator resources.
5. The resource optimization method for an OPC ecosystem matrix accelerator according to claim 4, characterized in that, If there are no available accelerator resources in the target matrix block that meet the computational requirements, then target accelerator resources that meet the computational requirements are determined based on adjacent matrix blocks of the target matrix block, including: If there are no available accelerator resources in the target matrix block that meet the computational requirements, then the next matrix block adjacent to the target matrix block is taken as the current target matrix block, and the process jumps to the step of determining whether there are available available accelerator resources in the target matrix block that meet the computational requirements, so as to obtain the target accelerator resources. If the target accelerator resource is not obtained, the previous matrix block adjacent to the target matrix block is taken as the current target matrix block, and the process jumps to the step of determining whether there is an idle accelerator resource in the target matrix block that meets the computational requirements, so as to obtain the target accelerator resource.
6. The resource optimization method for an OPC ecosystem matrix accelerator according to claim 5, characterized in that, If the data processing task of the target OPC service node meets the preset acceleration conditions, the data processing task is distributed to the corresponding accelerator execution node based on the resource mapping information, so that the accelerator execution node can execute the data processing task, including: If the resource mapping information indicates that the data processing task corresponds to a single accelerator execution node, and the data processing task meets the preset acceleration conditions, then the physical resource address of the target accelerator execution node is determined based on the accelerator execution node identifier and scheduling offset in the resource mapping information. The data processing task is sent to the target accelerator execution node corresponding to the target OPC service node through the physical resource address, so that the target accelerator execution node can execute the data processing task; The resource mapping information includes the accelerator execution node identifier corresponding to each matrix block, the hardware resource usage of each matrix block, and the scheduling offset.
7. The resource optimization method for an OPC ecosystem matrix accelerator according to claim 6, characterized in that, If the data processing task of the target OPC service node meets the preset acceleration conditions, the data processing task is distributed to the corresponding accelerator execution node based on the resource mapping information, so that the accelerator execution node can execute the data processing task. This also includes: If the resource mapping information represents the multi-accelerator execution node collaborative mode corresponding to the data processing task, then create a target task description file and save the scheduling offset in the resource mapping information as a collaborative offset to the private field of the target task description file. If the data processing task meets the preset acceleration conditions, the collaborative offset in the private field is loaded into the execution context of the data processing task, and the physical resource address corresponding to the target accelerator resource is found through the collaborative offset, so that the data processing task can be executed in parallel on multiple accelerator execution nodes based on the physical resource address.
8. The resource optimization method for an OPC ecosystem matrix accelerator according to claim 7, characterized in that, The method further includes: Record the target starting matrix coordinates of the resource region to be released in several target resource allocation schemes, as well as the target ending matrix coordinates after granular alignment of the resource region to be released. The occupancy status of the resource unit corresponding to the target starting matrix coordinates is detected by a preset resource bitmap. If it is free, the end matrix coordinates that are the same as the target starting matrix coordinates are found, and the first resource area to be merged and the resource area to be released corresponding to the end matrix coordinates are merged to obtain the first merged area. The system detects the occupancy status of resource units corresponding to the target end matrix coordinates using a preset resource bitmap. If the resource unit is free, it searches for the starting matrix coordinates that are the same as the target end matrix coordinates and merges the second resource region to be merged with the resource region to be released to obtain the second merged region.
9. The resource optimization method for an OPC ecosystem matrix accelerator according to claim 8, characterized in that, The method further includes: If the target accelerator resource is currently occupied, and a resource request for the target accelerator resource is received from a resource contention node among several OPC service nodes, the target accelerator resource will be set to an unavailable state through a preset interface, and the resource unschedulable information will be fed back to the resource contention node; the resource contention node is an OPC service node that is different from the target OPC service node. If the target accelerator resource has been released, the target accelerator resource will be set to an available state through a preset interface; If another request for target accelerator resources is received from a resource-contention node, the target accelerator resources will be allocated to the resource-contention node.
10. An OPC ecosystem matrix accelerator resource optimization application system, applicable to the OPC ecosystem matrix accelerator resource optimization method according to any one of claims 1-9, characterized in that, include: The feature extraction module is configured to receive resource scheduling requests from a target OPC service node, where the target OPC service node is any one of several OPC service nodes. Parse the OPC UA interaction data corresponding to the resource scheduling request, and extract the interaction frequency features and interaction latency features based on the OPC UA interaction data to determine the interaction relationship feature vector corresponding to the OPC UA interaction data; The node clustering module is configured to cluster several OPC service nodes based on interaction relationship feature vectors and historical interaction logs collected between several OPC service nodes, so as to obtain several OPC service node clusters and determine the cluster priority information corresponding to several OPC service node clusters. The matrix partitioning module is configured to associate and store cluster priority information with the corresponding matrix elements of the OPC ecosystem interaction matrix to obtain the optimized OPC ecosystem interaction matrix, and then divide the optimized OPC ecosystem interaction matrix into several matrix blocks. The feature matching module is configured to encode several matrices into blocks as first interactive feature vectors, and to perform parallel matching between the first interactive feature vectors and the second interactive feature vectors in the historical resource configuration matrix stored in the accelerator to obtain matching information. The block mapping module is configured to determine the scheduling offset based on the resource scheduling tag information in the matching information, and to map several matrices to the hardware resource pools of several accelerator execution nodes according to the scheduling offset, so as to obtain several target resource allocation schemes. The resource optimization module is configured to return the resource mapping information in the target resource allocation scheme to the target OPC service node, so that the target OPC service node can determine the accelerator execution node corresponding to the target resource allocation scheme based on the resource mapping information. If the data processing task of the target OPC service node meets the preset acceleration conditions, the data processing task is sent to the corresponding accelerator execution node based on the resource mapping information so that the accelerator execution node can execute the data processing task.