A Semantic Rule Network Partitioning Method and Device Based on Urban Social Governance Database
By obtaining the performance indicators of the target processor and the amount of data to be processed, a network partitioning strategy is generated to reasonably divide the semantic rule network, which solves the problem of the difficulty in partitioning the semantic rule network and achieves savings in the number of processors and improvement in the performance of the rule processing system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TSINGHUA UNIVERSITY
- Filing Date
- 2023-01-11
- Publication Date
- 2026-05-26
AI Technical Summary
In existing technologies, semantic rule networks are difficult to divide efficiently, resulting in a waste of processors and insufficient performance of rule processing systems.
By acquiring the performance metrics data of the target processor and the amount of data to be processed, network partitioning instructions are generated. Based on the relationship between the performance metrics and the amount of data to be processed, a network partitioning strategy is generated to reasonably divide the network into subnets to minimize the number of processors while meeting performance requirements.
This approach achieves the goal of meeting the performance requirements of a rule-based processing system while saving on the number of processors, thereby improving processing efficiency.
Smart Images

Figure CN116187447B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, specifically to a method and apparatus for semantic rule network partitioning based on a municipal social governance database. Additionally, it relates to an electronic device and a processor-readable storage medium. Background Technology
[0002] Heterogeneous data on "people, places, things, situations, events, and organizations" in a region constitute its social governance data, such as data on population mobility intensity and consumption data. The volume of social governance data is enormous, with various time-series data constantly being updated daily. The rule processing engine needs to process a large number of rules triggered by various events every day. Therefore, how to divide the semantic rule network triggered by this massive amount of time-series data has become a pressing problem to be solved. Summary of the Invention
[0003] To address this, the present invention provides a method and apparatus for dividing a semantic rule network based on a municipal social governance database, in order to overcome the shortcomings of existing technologies where semantic rule networks are difficult to divide, and to achieve the goal of minimizing the number of processors while meeting the performance requirements of the rule processing system.
[0004] In a first aspect, the present invention provides a semantic rule network partitioning method based on a municipal social governance database, comprising:
[0005] Acquire the first performance index data of the target processor and the first amount of data to be processed in the target semantic rule network;
[0006] If the first performance index data and the first amount of data to be processed meet the first preset condition, a network partitioning instruction is generated.
[0007] In response to the network partitioning instruction, the second amount of data to be processed in each subnet of the target semantic rule network and the second performance index data of the subprocessor corresponding to each subnet are obtained;
[0008] Based on the relationship between the second performance index data and the second amount of data to be processed, a network partitioning strategy is generated, which is used to partition each of the subnets.
[0009] According to the semantic rule network partitioning method based on a municipal social governance database provided by the present invention, when the first performance index data and the first amount of data to be processed meet a first preset condition, a network partitioning instruction is generated, specifically including:
[0010] If the first performance index data does not meet the processing volume requirements of the first amount of data to be processed, a network partitioning instruction is generated.
[0011] According to the semantic rule network partitioning method based on a municipal social governance database provided by the present invention, the method acquires the first performance index data of the target processor and the first amount of data to be processed in the target semantic rule network, and then further includes:
[0012] If the first performance index data meets the processing requirements of the first amount of data to be processed, then the program ends.
[0013] According to the semantic rule network partitioning method based on a municipal social governance database provided by the present invention, a network partitioning strategy is generated based on the relationship between the second performance index data and the second amount of data to be processed. The network partitioning strategy is used to partition each of the subnets, specifically including:
[0014] If the amount of the second data to be processed in each subnet is less than the second performance index data of the corresponding subprocessor, then the subnets will be combined and divided according to the principle of minimizing the number of processors.
[0015] According to the semantic rule network partitioning method based on a municipal social governance database provided by the present invention, the subnets are combined and partitioned according to the principle of minimizing the number of processors, specifically including:
[0016] Get the number of subprocessors corresponding to the subnet;
[0017] Calculate the sum of the second unprocessed data volume of each subnet in the target semantic rule network;
[0018] Based on the sum of the second amount of data to be processed and the number of sub-processors, calculate the average amount of data to be processed per sub-processor;
[0019] Based on the average amount of data to be processed, the subnets are combined so that the second amount of data to be processed in the combined subnet is equal to the average amount of data to be processed within a preset range of data to be processed fluctuation.
[0020] The combined subnets are then assigned to subprocessors for processing.
[0021] According to the semantic rule network partitioning method based on a municipal social governance database provided by the present invention, a network partitioning strategy is generated based on the relationship between the second performance index data and the second amount of data to be processed. The network partitioning strategy is used to partition each of the subnets, specifically including:
[0022] If there exists a subnet with a second amount of data to be processed that is greater than the second performance index data of the corresponding subprocessor, then the single subnet with a second amount of data to be processed that is less than the second performance index data of the corresponding subprocessor is divided according to the principle of minimum number, and the single subnet with a second amount of data to be processed that is greater than the second performance index data of the corresponding subprocessor is divided until its processing performance meets the requirements.
[0023] According to the semantic rule network partitioning method based on a municipal social governance database provided by the present invention, a single subnet with a second amount of data to be processed that is less than the second performance index data of the corresponding subprocessor is partitioned according to the principle of minimum number, and a single subnet with a second amount of data to be processed that is greater than the second performance index data of the corresponding subprocessor is partitioned until its processing performance meets the requirements. Specifically, it includes:
[0024] Get the number of subprocessors corresponding to the subnet;
[0025] Calculate the sum of the second unprocessed data volume of each subnet in the target semantic rule network;
[0026] Based on the sum of the second amount of data to be processed and the number of sub-processors, calculate the average amount of data to be processed per sub-processor;
[0027] Based on the average amount of data to be processed, subnets with a second amount of data to be processed that is less than the average amount of data to be processed are combined, and subnets with a second amount of data to be processed that is greater than the average amount of data to be processed are divided, so that the amount of data to be processed in the combined or divided subnets is equal to the average amount of data to be processed within a preset range of data to be processed fluctuation.
[0028] The combined subnets are then assigned to subprocessors for processing.
[0029] Secondly, the present invention also provides a semantic rule network partitioning device based on a municipal social governance database, comprising:
[0030] The first acquisition unit is used to acquire the first performance index data of the target processor and the first amount of data to be processed in the target semantic rule network.
[0031] The instruction generation unit is used to generate a network partitioning instruction when the first performance index data and the first amount of data to be processed meet a first preset condition.
[0032] The second acquisition unit is used to acquire, in response to the network partitioning instruction, the second amount of data to be processed in each subnet of the target semantic rule network and the second performance index data of the subprocessor corresponding to each subnet;
[0033] The partitioning unit is used to generate a network partitioning strategy based on the relationship between the second performance index data and the second amount of data to be processed. The network partitioning strategy is used to partition each of the subnets.
[0034] Thirdly, the present invention also provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the semantic rule network partitioning method based on the municipal social governance database as described in any of the above claims.
[0035] Fourthly, the present invention also provides a processor-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the semantic rule network partitioning method based on a municipal social governance database as described in any of the preceding claims.
[0036] The present invention provides a method and apparatus for partitioning a semantic rule network based on a municipal social governance database. This method involves acquiring first performance index data of a target processor and a first amount of data to be processed in the target semantic rule network; generating a network partitioning instruction when the first performance index data and the first amount of data to be processed meet a first preset condition; responding to the network partitioning instruction, acquiring a second amount of data to be processed in each subnet of the target semantic rule network and second performance index data of the subprocessor corresponding to each subnet; and generating a network partitioning strategy based on the relationship between the second performance index data and the second amount of data to be processed, which is used to partition each subnet. The present invention partitions subnets according to a preset partitioning method based on the comparison results of performance index data and the amount of data to be processed, providing a feasible method for partitioning the semantic rule network for municipal social governance, while minimizing the number of processors and meeting the performance requirements of the rule processing system. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 This is one of the flowcharts illustrating the semantic rule network partitioning method based on a municipal social governance database provided by the present invention;
[0039] Figure 2 This is the second flowchart illustrating the semantic rule network partitioning method based on a municipal social governance database provided by this invention.
[0040] Figure 3 This is a flowchart illustrating an embodiment of the semantic rule network partitioning method based on a municipal social governance database provided by the present invention.
[0041] Figure 4 This is a schematic diagram of the semantic rule network partitioning device based on a municipal social governance database provided by the present invention;
[0042] Figure 5 This is a schematic diagram of the physical structure of the electronic device provided by the present invention.
[0043] Figure label:
[0044] 410: First acquisition unit; 420: Instruction generation unit; 430: Second acquisition unit; 440: Division unit;
[0045] 510: Processor; 520: Communication interface; 530: Memory; 540: Communication bus. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, 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.
[0047] The following is combined Figures 1-3 This invention describes the semantic rule network partitioning method based on a municipal social governance database, and provides a detailed description of its embodiments. Figure 1 This is one of the flowcharts illustrating the semantic rule network partitioning method based on a municipal social governance database provided by the present invention, such as... Figure 1 The diagram shown is a flowchart illustrating the semantic rule network partitioning method based on a municipal social governance database provided in this embodiment of the invention. The specific implementation process includes the following steps:
[0048] Step 110: Obtain the first performance index data of the target processor and the first amount of data to be processed in the target semantic rule network.
[0049] like Figure 2 The semantic rule network partitioning method based on the municipal social governance database involves three parts: the municipal social governance database, the municipal social governance semantic rule network, and semantic rule execution.
[0050] The urban social governance database refers to various databases that can trigger semantic rules for urban social governance. These databases are distributed and stored in different locations. If there are m locations, it means there are m urban social governance databases.
[0051] The urban social governance semantic rule network refers to a rule network composed of semantic rules from urban social governance databases distributed across m locations. The semantic rule network is divided according to a specific algorithm, and then distributed to one or more processors for parallel processing, thereby improving processing efficiency.
[0052] Semantic rule execution refers to the execution of various semantic rules triggered when data changes.
[0053] The purpose of this invention is to design a semantic rule network partitioning algorithm that allows more processors to process these dynamically triggered rule networks in parallel, thereby saving the number of processors while still meeting the performance requirements of the rule processing system.
[0054] In practice, the first performance metric data includes the target processor's performance metric data; the first amount of data to be processed includes the amount of data to be processed from the target semantic rule network. The data to be processed includes rules triggered by databases distributed throughout the target semantic rule network.
[0055] First, a performance analysis is performed on the entire target semantic rule network and the target processor to determine whether the first performance index data and the first amount of data to be processed meet the first preset condition.
[0056] Step 120: If the first performance index data and the first amount of data to be processed meet the first preset condition, generate a network partitioning instruction.
[0057] The first preset condition includes: the first performance index data does not meet the processing volume requirement of the first amount of data to be processed, that is, the first performance index data is less than the first amount of data to be processed.
[0058] If the first performance index data does not meet the processing volume requirement of the first amount of data to be processed, under the condition that the first preset condition is met, that is, the target processor cannot process the rules triggered by the database to be processed distributed in all places of the target semantic rule network, then semantic rule network partitioning is performed and network partitioning instructions are generated.
[0059] If the first preset condition is not met, and the first performance index data meets the processing volume requirement of the first amount of data to be processed, that is, if the target processor can process the rules triggered by the database to be processed distributed in all places of the target semantic rule network, then there is no need to perform semantic rule network partitioning.
[0060] Step 130: In response to the network partitioning instruction, obtain the second amount of data to be processed for each subnet in the target semantic rule network and the second performance index data of the subprocessor corresponding to each subnet.
[0061] After generating the network partitioning instructions, the performance of the distributed subnets and subprocessors is compared. In actual operation, the second amount of data to be processed in each subnet of the target semantic rule network and the second performance index data of the corresponding subprocessor in each subnet are obtained, and the relationship between the second performance index data and the second amount of data to be processed is determined.
[0062] Step 140: Based on the relationship between the second performance index data and the second amount of data to be processed, a network partitioning strategy is generated, which is used to partition each of the subnets.
[0063] A network partitioning strategy is generated based on the relationship between the second performance index data and the second amount of data to be processed, and each subnet is partitioned according to the network partitioning strategy.
[0064] Based on the above embodiments, in this method, when the first performance index data and the first amount of data to be processed meet a first preset condition, a network partitioning instruction is generated, specifically including:
[0065] If the first performance index data does not meet the processing volume requirements of the first amount of data to be processed, a network partitioning instruction is generated.
[0066] Specifically, the first preset condition includes: the first performance index data does not meet the processing volume requirement of the first amount of data to be processed, that is, the first performance index data is less than the first amount of data to be processed.
[0067] If the first performance index data does not meet the processing volume requirement of the first amount of data to be processed, under the condition that the first preset condition is met, that is, the target processor cannot process the rules triggered by the database to be processed distributed in all places of the target semantic rule network, then semantic rule network partitioning is performed and network partitioning instructions are generated.
[0068] Based on the above embodiments, the method, after obtaining the first performance index data of the target processor and the first amount of data to be processed from the target semantic rule network, further includes:
[0069] If the first performance index data meets the processing requirements of the first amount of data to be processed, then the program ends.
[0070] If the first preset condition is not met, and the first performance index data meets the processing volume requirement of the first amount of data to be processed, that is, if the target processor can process the rules triggered by the database to be processed distributed in all places of the target semantic rule network, then there is no need to perform semantic rule network partitioning.
[0071] Based on the above embodiments, in this method, a network partitioning strategy is generated according to the relationship between the second performance index data and the second amount of data to be processed. The network partitioning strategy is used to partition each of the subnets, specifically including:
[0072] If the amount of the second data to be processed in each subnet is less than the second performance index data of the corresponding subprocessor, then the subnets will be combined and divided according to the principle of minimizing the number of processors.
[0073] Specifically, after generating the network partitioning instructions, the performance of the distributed subnets and subprocessors is compared. In actual operation, the second amount of data to be processed in each subnet of the target semantic rule network and the second performance index data of the corresponding subprocessors in each subnet are obtained, and the relationship between the second performance index data and the second amount of data to be processed is determined.
[0074] A network partitioning strategy is generated based on the relationship between the second performance index data and the second amount of data to be processed, and each subnet is partitioned according to the network partitioning strategy.
[0075] If the amount of second data to be processed in each subnet is less than the second performance index data of the corresponding subprocessor, that is, if the processing workload of each subnet is less than the capacity index of the subprocessor, then the subnets will be combined and divided according to the principle of minimizing the number of processors.
[0076] Based on the above embodiments, in this method, the subnets are combined and divided according to the principle of minimizing the number of processors, specifically including:
[0077] Get the number of subprocessors corresponding to the subnet;
[0078] Calculate the sum of the second unprocessed data volume of each subnet in the target semantic rule network;
[0079] Based on the sum of the second amount of data to be processed and the number of sub-processors, calculate the average amount of data to be processed per sub-processor;
[0080] Based on the average amount of data to be processed, the subnets are combined so that the second amount of data to be processed in the combined subnet is equal to the average amount of data to be processed within a preset range of data to be processed fluctuation.
[0081] The combined subnets are then assigned to subprocessors for processing.
[0082] Specifically, the sum of the second unprocessed data volume of all subnets in the target semantic rule network is calculated. Based on the number of subprocessors corresponding to each subnet, the average unprocessed data volume per subprocessor is calculated. Based on the average unprocessed data volume, the subnets are combined according to the principle of minimizing the number of subnets. That is, within a preset range of unprocessed data volume fluctuation, the number of subnets in each combination is minimized while ensuring that the second unprocessed data volume of the combined subnets is equal to the average unprocessed data volume. Since the second unprocessed data volume of each subnet is less than the second performance index data of the corresponding subprocessor, the subnet with the largest second unprocessed data volume can be combined first, so that the second unprocessed data volume of the combined subnet is equal to the average unprocessed data volume within the preset range of unprocessed data volume fluctuation. Then, the remaining subnets are combined according to the principle of minimizing the number of subnets, so that the second unprocessed data volume of the combined subnet is equal to the average unprocessed data volume within the preset range of unprocessed data volume fluctuation. The combined subnets are then assigned to subprocessors for processing. The preset range of unprocessed data volume fluctuation can be 20%. For example:
[0083] (1) Assume that the semantic rule network has a total of 10 subnets. The computational cost of subnet 1 is 890 units; the computational cost of subnet 2 is 200 units; the computational cost of subnet 3 is 600 units; the computational cost of subnet 4 is 2200 units; the computational cost of subnet 5 is 1050 units; the computational cost of subnet 6 is 800 units; the computational cost of subnet 7 is 2100 units; the computational cost of subnet 8 is 100 units; the computational cost of subnet 9 is 280 units; and the computational cost of subnet 10 is 200 units.
[0084] (2) Assume that the processing is to be handled by 3 processors.
[0085] (3) The total cost of 10 subnets is: 890+200+600+2200+1050+800+2100+100+280+200=8420 units.
[0086] (4) The average computation cost per processor is 8420 / 3 = 2807 units.
[0087] (5) Subnet 3 + Subnet 4 = 600 + 2200 = 2800 units, which is close to the average cost (within the fluctuation range, assumed to be 20%). After these two subnets are merged, they can be handed over to processor 1 for processing;
[0088] (6) Subnet 2 + Subnet 7 + Subnet 9 + Subnet 10 = 200 + 2100 + 280 + 200 = 2780 units, which is close to the average cost (assuming a cost fluctuation range of 20%). After these 4 subnets are merged, they can be handed over to processor 2 for processing.
[0089] (7) After the last four subnets are merged, they are handed over to processor 3 for processing.
[0090] (8) Once the subnetting is complete, the processing cost for each processor is roughly the same.
[0091] Based on the above embodiments, in this method, a network partitioning strategy is generated according to the relationship between the second performance index data and the second amount of data to be processed. The network partitioning strategy is used to partition each of the subnets, specifically including:
[0092] If there exists a subnet with a second amount of data to be processed that is greater than the second performance index data of the corresponding subprocessor, then the single subnet with a second amount of data to be processed that is less than the second performance index data of the corresponding subprocessor is divided according to the principle of minimum number, and the single subnet with a second amount of data to be processed that is greater than the second performance index data of the corresponding subprocessor is divided until its processing performance meets the requirements.
[0093] Specifically, after generating the network partitioning instructions, the performance of the distributed subnets and subprocessors is compared. In actual operation, the second amount of data to be processed in each subnet of the target semantic rule network and the second performance index data of the corresponding subprocessors in each subnet are obtained, and the relationship between the second performance index data and the second amount of data to be processed is determined.
[0094] A network partitioning strategy is generated based on the relationship between the second performance index data and the second amount of data to be processed, and each subnet is partitioned according to the network partitioning strategy.
[0095] If the amount of second data to be processed in a subnet is greater than the second performance index data of the corresponding subprocessor, that is, if the processing workload of a subnet is greater than the capability index range of the subprocessor, then the subnets whose individual processing workload is less than the processing capability of the subprocessor are divided according to the principle of minimum number, and the large subnets that exceed the processing capability of the subprocessor are divided until their processing performance meets the requirements.
[0096] Based on the above embodiments, in this method, a single subnet whose second data volume is less than the second performance index data of the corresponding subprocessor is divided according to the principle of minimum number, and a single subnet whose second data volume is greater than the second performance index data of the corresponding subprocessor is divided, until its processing performance meets the requirements, specifically including:
[0097] Get the number of subprocessors corresponding to the subnet;
[0098] Calculate the sum of the second unprocessed data volume of each subnet in the target semantic rule network;
[0099] Based on the sum of the second amount of data to be processed and the number of sub-processors, calculate the average amount of data to be processed per sub-processor;
[0100] Based on the average amount of data to be processed, subnets with a second amount of data to be processed that is less than the average amount of data to be processed are combined, and subnets with a second amount of data to be processed that is greater than the average amount of data to be processed are divided, so that the amount of data to be processed in the combined or divided subnets is equal to the average amount of data to be processed within a preset range of data to be processed fluctuation.
[0101] The combined subnets are then assigned to subprocessors for processing.
[0102] Specifically, the sum of the second unprocessed data volume of all subnets in the target semantic rule network is calculated. Based on the number of subprocessors corresponding to each subnet, the average unprocessed data volume per subprocessor is calculated. Based on the average unprocessed data volume, subnets with second unprocessed data volumes greater than the average unprocessed data volume are divided, so that the processing performance of the divided subnets meets the requirements within the preset unprocessed data volume fluctuation range.
[0103] Individual subnets whose second data volume is less than the second performance index data of the corresponding subprocessor are combined according to the principle of minimizing the number of subnets. That is, within a preset range of data volume fluctuation, the number of subnets in each combination is minimized while ensuring that the second data volume of the combined subnets is equal to the average data volume. The combined subnets are then assigned to subprocessors for processing. The preset range of data volume fluctuation can be 20%. For example:
[0104] (1) Assume that the semantic rule network has 4 subnets. The computation cost of subnet 1 is 1000 computation costs; the computation cost of subnet 2 is 2000 computation costs; the computation cost of subnet 3 is 2010 computation costs; and the computation cost of subnet 4 is 10080 computation costs.
[0105] (2) Assume that the data needs to be processed in parallel by 3 processors.
[0106] (3) The total processing cost of the semantic rule network is: 1000+2000+2010+10080=15090 computational costs.
[0107] (4) The average processing cost per processor is approximately 15090 / 3 = 5030 units of calculation.
[0108] (5) The total computational cost of merging subnet 1, subnet 2, and subnet 3 is 5010 computational units, which is close to the average cost (within the fluctuation range, assumed to be 20%). After merging these 3 subnets, they can be handed over to processor 1 for processing.
[0109] (6) Subnet 4 needs to be roughly evenly distributed to processors 2 and 3 for processing.
[0110] Based on the above embodiments, the present invention provides an example of completing a partitioning operation using the semantic rule network partitioning method based on the urban social governance database, such as... Figure 3 The present invention is implemented through the following technical solutions:
[0111] Acquire the first performance index data of the target processor and the first amount of data to be processed in the target semantic rule network;
[0112] Determine whether the first performance index data meets the processing volume requirements of the first amount of data to be processed:
[0113] If yes, terminate the program; otherwise, generate network partitioning instructions.
[0114] In response to the network partitioning instruction, the second performance index data of each subnet in the target semantic rule network is compared with the second amount of data to be processed by the subprocessor corresponding to each subnet:
[0115] If the amount of the second data to be processed in each subnet is less than the second performance index data of the corresponding subprocessor, then the subnets will be combined and divided according to the principle of minimizing the number of processors.
[0116] If there exists a subnet with a second amount of data to be processed that is greater than the second performance index data of the corresponding subprocessor, then the single subnet with a second amount of data to be processed that is less than the second performance index data of the corresponding subprocessor is divided according to the principle of minimum number, and the single subnet with a second amount of data to be processed that is greater than the second performance index data of the corresponding subprocessor is divided until its processing performance meets the requirements.
[0117] In the above specific embodiments, the semantic rule network partitioning method based on a municipal social governance database provided by the present invention obtains the first performance index data of the target processor and the first amount of data to be processed in the target semantic rule network; when the first performance index data and the first amount of data to be processed meet a first preset condition, a network partitioning instruction is generated; in response to the network partitioning instruction, the second amount of data to be processed in each subnet of the target semantic rule network and the second performance index data of the subprocessor corresponding to each subnet are obtained; according to the relationship between the second performance index data and the second amount of data to be processed, a network partitioning strategy is generated, which is used to partition each subnet. The present invention partitions subnets according to a preset partitioning method based on the comparison results of performance index data and the amount of data to be processed, providing a feasible method for partitioning the semantic rule network of municipal social governance, which can meet the performance requirements of the rule processing system while minimizing the number of processors.
[0118] The semantic rule network partitioning device based on the municipal social governance database provided by the present invention will be described below. The semantic rule network partitioning device based on the municipal social governance database described below can be referred to in correspondence with the semantic rule network partitioning method based on the municipal social governance database described above.
[0119] Figure 4 This is a schematic diagram of the semantic rule network partitioning device based on a municipal social governance database provided by the present invention, as shown below. Figure 4 As shown, this embodiment of the invention provides a semantic rule network partitioning device based on a city-wide social governance database, comprising: a first acquisition unit 410, an instruction generation unit 420, a second acquisition unit 430, and a partitioning unit 440.
[0120] in,
[0121] The first acquisition unit 410 is used to acquire the first performance index data of the target processor and the first amount of data to be processed of the target semantic rule network.
[0122] The instruction generation unit 420 is used to generate a network partitioning instruction when the first performance index data and the first amount of data to be processed meet a first preset condition.
[0123] The second acquisition unit 430 is used to acquire, in response to the network partitioning instruction, the second amount of data to be processed in each subnet of the target semantic rule network and the second performance index data of the subprocessor corresponding to each subnet;
[0124] The partitioning unit 440 is used to generate a network partitioning strategy based on the relationship between the second performance index data and the second amount of data to be processed. The network partitioning strategy is used to partition each of the subnets.
[0125] Based on the above embodiments, in this device, when the first performance index data and the first amount of data to be processed meet a first preset condition, a network partitioning instruction is generated, specifically including:
[0126] If the first performance index data does not meet the processing volume requirements of the first amount of data to be processed, a network partitioning instruction is generated.
[0127] Based on the above embodiments, the device acquires first performance index data of the target processor and first amount of data to be processed from the target semantic rule network, and then further includes:
[0128] If the first performance index data meets the processing requirements of the first amount of data to be processed, then the program ends.
[0129] Based on the above embodiments, in this device, a network partitioning strategy is generated according to the relationship between the second performance index data and the second amount of data to be processed. The network partitioning strategy is used to partition each of the subnets, specifically including:
[0130] If the amount of the second data to be processed in each subnet is less than the second performance index data of the corresponding subprocessor, then the subnets will be combined and divided according to the principle of minimizing the number of processors.
[0131] Based on the above embodiments, in this device, the subnets are combined and divided according to the principle of minimizing the number of processors, specifically including:
[0132] Get the number of subprocessors corresponding to the subnet;
[0133] Calculate the sum of the second unprocessed data volume of each subnet in the target semantic rule network;
[0134] Based on the sum of the second amount of data to be processed and the number of sub-processors, calculate the average amount of data to be processed per sub-processor;
[0135] Based on the average amount of data to be processed, the subnets are combined so that the second amount of data to be processed in the combined subnet is equal to the average amount of data to be processed within a preset range of data to be processed fluctuation.
[0136] The combined subnets are then assigned to subprocessors for processing.
[0137] Based on the above embodiments, in this device, a network partitioning strategy is generated according to the relationship between the second performance index data and the second amount of data to be processed. The network partitioning strategy is used to partition each of the subnets, specifically including:
[0138] If there exists a subnet with a second amount of data to be processed that is greater than the second performance index data of the corresponding subprocessor, then the single subnet with a second amount of data to be processed that is less than the second performance index data of the corresponding subprocessor is divided according to the principle of minimum number, and the single subnet with a second amount of data to be processed that is greater than the second performance index data of the corresponding subprocessor is divided until its processing performance meets the requirements.
[0139] Based on the above embodiments, in this device, a single subnet whose second data volume is less than the second performance index data of the corresponding subprocessor is divided according to the principle of minimum number, and a single subnet whose second data volume is greater than the second performance index data of the corresponding subprocessor is divided, until its processing performance meets the requirements, specifically including:
[0140] Get the number of subprocessors corresponding to the subnet;
[0141] Calculate the sum of the second unprocessed data volume of each subnet in the target semantic rule network;
[0142] Based on the sum of the second amount of data to be processed and the number of sub-processors, calculate the average amount of data to be processed per sub-processor;
[0143] Based on the average amount of data to be processed, subnets with a second amount of data to be processed that is less than the average amount of data to be processed are combined, and subnets with a second amount of data to be processed that is greater than the average amount of data to be processed are divided, so that the amount of data to be processed in the combined or divided subnets is equal to the average amount of data to be processed within a preset range of data to be processed fluctuation.
[0144] The combined subnets are then assigned to subprocessors for processing.
[0145] In the above specific embodiments, the semantic rule network partitioning device based on a municipal social governance database provided by the present invention acquires first performance index data of the target processor and first amount of data to be processed in the target semantic rule network; generates a network partitioning instruction when the first performance index data and the first amount of data to be processed meet a first preset condition; responds to the network partitioning instruction, acquires second amount of data to be processed in each subnet of the target semantic rule network and second performance index data of the subprocessor corresponding to each subnet; and generates a network partitioning strategy based on the relationship between the second performance index data and the second amount of data to be processed, the network partitioning strategy being used to partition each subnet. The present invention partitions subnets according to a preset partitioning method based on the comparison results of performance index data and the amount of data to be processed, providing a feasible method for partitioning the semantic rule network of municipal social governance, which can meet the performance requirements of the rule processing system while minimizing the number of processors.
[0146] It should be noted that the apparatus provided in this embodiment of the invention can implement all the method steps implemented in the above method embodiment and can achieve the same technical effect. Therefore, the parts and beneficial effects that are the same as those in the method embodiment will not be described in detail here.
[0147] Figure 5 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5 As shown, the electronic device may include a processor 510, a communication interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute a semantic rule network partitioning method based on a municipal social governance database. The method includes: acquiring first performance index data of the target processor and a first amount of data to be processed in the target semantic rule network; generating a network partitioning instruction when the first performance index data and the first amount of data to be processed meet a first preset condition; in response to the network partitioning instruction, acquiring a second amount of data to be processed in each subnet of the target semantic rule network and second performance index data of the subprocessor corresponding to each subnet; and generating a network partitioning strategy based on the relationship between the second performance index data and the second amount of data to be processed, wherein the network partitioning strategy is used to partition each subnet.
[0148] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0149] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements a semantic rule network partitioning method based on a municipal social governance database provided by the above methods. The method includes: acquiring first performance index data of a target processor and a first amount of data to be processed in the target semantic rule network; generating a network partitioning instruction when the first performance index data and the first amount of data to be processed meet a first preset condition; in response to the network partitioning instruction, acquiring a second amount of data to be processed in each subnet of the target semantic rule network and second performance index data of the subprocessor corresponding to each subnet; and generating a network partitioning strategy based on the relationship between the second performance index data and the second amount of data to be processed, wherein the network partitioning strategy is used to partition each subnet.
[0150] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0151] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0152] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A semantic rule network partitioning method based on a municipal area social governance database, characterized in that, include: Acquire the first performance index data of the target processor and the first amount of data to be processed in the target semantic rule network; If the first performance index data and the first amount of data to be processed meet the first preset condition, a network partitioning instruction is generated. In response to the network partitioning instruction, the second amount of data to be processed in each subnet of the target semantic rule network and the second performance index data of the subprocessor corresponding to each subnet are obtained; Based on the relationship between the second performance index data and the second amount of data to be processed, a network partitioning strategy is generated. This network partitioning strategy is used to partition each of the subnets, including: If there exists a subnet with a second amount of data to be processed that is greater than the second performance index data of the corresponding sub-processor, then obtain the number of sub-processors corresponding to the subnet; Calculate the sum of the second unprocessed data volume of each subnet in the target semantic rule network; Based on the sum of the second amount of data to be processed and the number of sub-processors, calculate the average amount of data to be processed per sub-processor; Based on the average amount of data to be processed, subnets with a second amount of data to be processed that is less than the average amount of data to be processed are combined, and subnets with a second amount of data to be processed that is greater than the average amount of data to be processed are divided, so that the amount of data to be processed in the combined or divided subnets is equal to the average amount of data to be processed within a preset range of data to be processed fluctuation. The combined subnets are then assigned to subprocessors for processing. 2.The method of claim 1, wherein, When the first performance index data and the first amount of data to be processed meet the first preset condition, a network partitioning instruction is generated, specifically including: If the first performance index data does not meet the processing volume requirements of the first amount of data to be processed, a network partitioning instruction is generated. 3.The method of claim 1, wherein, After obtaining the first performance index data of the target processor and the first amount of data to be processed in the target semantic rule network, the process also includes: If the first performance index data meets the processing requirements of the first amount of data to be processed, then the program ends.
4. The semantic rule net partitioning method based on the municipal area social governance database according to claim 1 or 2, characterized in that, Based on the relationship between the second performance index data and the second amount of data to be processed, a network partitioning strategy is generated. This strategy is used to partition the network into subnets, specifically including: If the amount of the second data to be processed in each subnet is less than the second performance index data of the corresponding subprocessor, then the subnets will be combined and divided according to the principle of minimizing the number of processors.
5. The semantic rule network partitioning method based on a municipal social governance database according to claim 4, characterized in that, The subnets are combined and divided according to the principle of minimizing the number of processors, specifically including: Get the number of subprocessors corresponding to the subnet; Calculate the sum of the second unprocessed data volume of each subnet in the target semantic rule network; Based on the sum of the second amount of data to be processed and the number of sub-processors, calculate the average amount of data to be processed per sub-processor; Based on the average amount of data to be processed, the subnets are combined so that the second amount of data to be processed in the combined subnet is equal to the average amount of data to be processed within a preset range of data to be processed fluctuation. The combined subnets are then assigned to subprocessors for processing.
6. A semantic rule network partitioning device based on a municipal social governance database, characterized in that, include: The first acquisition unit is used to acquire the first performance index data of the target processor and the first amount of data to be processed in the target semantic rule network. The instruction generation unit is used to generate a network partitioning instruction when the first performance index data and the first amount of data to be processed meet a first preset condition. The second acquisition unit is used to acquire, in response to the network partitioning instruction, the second amount of data to be processed in each subnet of the target semantic rule network and the second performance index data of the subprocessor corresponding to each subnet; A partitioning unit is used to generate a network partitioning strategy based on the relationship between the second performance index data and the second amount of data to be processed. The network partitioning strategy is used to partition each of the subnets, including: If there exists a subnet with a second amount of data to be processed that is greater than the second performance index data of the corresponding sub-processor, then obtain the number of sub-processors corresponding to the subnet; Calculate the sum of the second unprocessed data volume of each subnet in the target semantic rule network; Based on the sum of the second amount of data to be processed and the number of sub-processors, calculate the average amount of data to be processed per sub-processor; Based on the average amount of data to be processed, subnets with a second amount of data to be processed that is less than the average amount of data to be processed are combined, and subnets with a second amount of data to be processed that is greater than the average amount of data to be processed are divided, so that the amount of data to be processed in the combined or divided subnets is equal to the average amount of data to be processed within a preset range of data to be processed fluctuation. The combined subnets are then assigned to subprocessors for processing.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the semantic rule network partitioning method based on the urban social governance database as described in any one of claims 1 to 5.
8. A processor-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the semantic rule network partitioning method based on the urban social governance database as described in any one of claims 1 to 5.