Service sequence generation method and system, storage medium, product and electronic equipment
By identifying and sorting the affected node set in discrete manufacturing and integrating it with the unaffected nodes to generate the final business sequence, the problem of high computational load during process route changes is solved, the generation efficiency is improved, and the identification of cyclic sequences enhances the stability of production management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-11
- Publication Date
- 2026-04-10
AI Technical Summary
In discrete manufacturing, existing technologies require recalculation of all nodes when the process route changes, resulting in high computational load, affecting the efficiency of business sequence generation, and potentially leading to cyclic sequences, which in turn affects production management efficiency.
By identifying the set of affected nodes after the change, sorting them, generating affected subsequences, and integrating them with unaffected subsequences, a final business sequence is generated and identified as a link node.
It improves the efficiency of business sequence acquisition, reduces computational overhead, minimizes the impact on downstream systems, and quickly identifies cyclic sequences, thereby improving the stability of production management.
Smart Images

Figure CN121836296A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of process route scheduling of discrete manufacturing, in particular to a business sequence generation method and system, a storage medium, a product and an electronic device. BACKGROUND
[0002] In discrete manufacturing, the process route often presents a complex nonlinear network structure. When processing such data, the traditional manufacturing execution system (MES, Manufacturing Execution System) or enterprise resource planning (ERP, Enterprise Resource Planning) system needs to use the traditional topological sorting to recalculate the full amount of nodes to obtain the business sequence every time the process route is slightly changed (for example, adding, deleting or modifying the correlation). In the case of long process route or large-scale concurrent modification, the calculation load is high.
[0003] Therefore, how to improve the efficiency of obtaining the business sequence is a technical problem to be solved in the field. SUMMARY
[0004] The purpose of the present application is to provide at least a business sequence generation method for discrete manufacturing, which can improve the efficiency of obtaining the business sequence.
[0005] In a first aspect, the present application provides a business sequence generation method for discrete manufacturing, comprising: obtaining an original business sequence before change, and a current node set, a logical relationship between current nodes and a change node set after change, wherein the current nodes belong to the current node set, and the change node set is a subset of the current node set; obtaining a logical relationship between an affected node set and affected nodes according to the logical relationship between the change node set and the current nodes, wherein the affected node set is at least part of the current node set, and the affected nodes belong to the affected node set; if the proportion of the affected node set in the current node set is less than a preset threshold, sorting the affected nodes according to the logical relationship between the affected node set and the affected nodes to obtain an affected subsequence, wherein the node set in the affected subsequence is at least part of the affected node set; extracting an unaffected subsequence from the original business sequence, and obtaining a final business sequence according to the affected subsequence and the unaffected subsequence.
[0006] Optionally, the method further comprises: comparing the number of nodes in the current node set and the final service sequence, if the number of nodes is inconsistent, determining that there is at least one loop node in the current node set; obtaining the loop node according to the logical relationship between the current nodes and the current node set.
[0007] Optionally, each current node contains its hierarchical information, each node in the original service sequence has its own number, and the final service sequence is obtained according to the affected sub-sequence and the non-affected sub-sequence, including: Step a, taking out the first node of the affected sub-sequence and the non-affected sub-sequence, comparing the hierarchical information and the number of the two nodes taken out, determining the to-be-inserted node according to the comparison result and inserting it into the sequence, the to-be-inserted node is one of the two nodes, and the other of the two nodes is the remaining node; Step b, taking out the next node in the sub-sequence to which the to-be-inserted node belongs, comparing the hierarchical information and the number of the remaining node and the next node taken out, updating the to-be-inserted node according to the comparison result and inserting it into the sequence, and updating the remaining node; repeating the step b until the sequence contains all nodes in the non-affected sub-sequence; Step c, inserting the part of the affected sub-sequence that has not been taken out into the end of the sequence, and taking the sequence as the final service sequence.
[0008] Optionally, the taking out the first node of the affected sub-sequence and the non-affected sub-sequence, and comparing the hierarchical information and the number of the two nodes taken out, includes: verifying the two nodes taken out according to the logical relationship between the current nodes; if the node taken out in the non-affected sub-sequence is before the node taken out in the affected sub-sequence, comparing the hierarchical information and the number of the two nodes taken out.
[0009] Optionally, the taking out the next node in the sub-sequence to which the to-be-inserted node belongs, and comparing the hierarchical information and the number of the remaining node and the next node taken out, includes: verifying the remaining node and the next node taken out according to the logical relationship between the current nodes; if the node belonging to the non-affected sub-sequence is before the node belonging to the affected sub-sequence in the two nodes being verified, comparing the hierarchical information and the number of the remaining node and the next node taken out.
[0010] Optionally, the determining or updating the to-be-inserted node according to the comparison result and inserting it into the sequence includes: In response to the two nodes currently being compared both containing the number and the hierarchical information being the same, inserting the node with earlier ordering into the sequence according to the ordering of the two nodes in the original service sequence.
[0011] Optionally, the affected node set contains a new node, the new node not containing the number, the original service sequence not containing the new node, and the determining or updating the node to be inserted and inserting the node to be inserted into the sequence according to the comparison result comprising: In response to the two nodes currently being compared both containing the number and the hierarchical information being the same, inserting the node with earlier ordering into the sequence according to the ordering of the two nodes in the original service sequence.
[0012] Optionally, the determining or updating the node to be inserted and inserting the node to be inserted into the sequence according to the comparison result comprising: In response to the two nodes currently being compared both containing the number and the hierarchical information being the same, inserting the node with earlier ordering into the sequence according to the ordering of the two nodes in the original service sequence.
[0013] In a second aspect, an embodiment of the present application provides a service sequence generation system for discrete manufacturing, comprising: a data acquisition module configured to acquire an original service sequence before a change, and a current node set after the change, a logical relationship between current nodes, and a change node set, the current nodes belonging to the current node set, and the change node set being a subset of the current node set; a node acquisition module configured to acquire a logical relationship between an affected node set and affected nodes according to the logical relationship between the change node set and the current nodes, wherein the affected node set is at least a part of the current node set, and the affected nodes belong to the affected node set; an ordering module configured to order the affected nodes according to the logical relationship between the affected node set and the affected nodes, and acquire an affected sub-sequence, if a proportion of the affected node set in the current node set is less than a preset threshold, wherein a node set in the affected sub-sequence is at least a part of the affected node set; and a sequence integration module configured to extract an unaffected sub-sequence according to the original service sequence, and acquire a final service sequence according to the affected sub-sequence and the unaffected sub-sequence.
[0014] In a third aspect, an embodiment of the present application further provides a computer readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the steps of any of the service sequence generation methods for discrete manufacturing described above.
[0015] In a fourth aspect, the present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of any of the above-described business sequence generation methods for discrete manufacturing.
[0016] In a fifth aspect, the present application also provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program capable of running on the processor, and wherein the processor executes the steps of any of the above-described business sequence generation methods for discrete manufacturing when running the computer program.
[0017] Compared with the prior art, the technical scheme of the embodiment of the present application has the following beneficial effects: In the embodiment of the present application, when generating the final business sequence according to the changed process route, the nodes in the current process route are divided into affected nodes and non-affected nodes, when the proportion of the affected nodes in the current node set is less than a preset threshold, only the set of affected nodes is sorted to obtain an affected sub-sequence, a non-affected sub-sequence is obtained according to the original business sequence, and the affected sub-sequence and the non-affected sub-sequence are integrated to obtain the final business sequence. Thus, the number of nodes subjected to sorting is reduced, the calculation cost in the process of obtaining the final business sequence is reduced, the required time for obtaining the final business sequence is shortened, and the efficiency of obtaining the final business sequence is improved.
[0018] Further, when integrating the affected sub-sequence and the non-affected sub-sequence, the sorting results of the nodes in the original business sequence are preserved as much as possible. Thus, the modification of the database when updating the business sequence is reduced, thereby reducing the influence on the downstream business system and improving the stability of the business sequence.
[0019] Further, after obtaining the final business sequence, it is determined whether there is a loop sequence in the current process route according to the number of nodes in the final business sequence, if there is, the loop nodes are obtained according to the logical relationship between the current nodes. Thus, after the process route is changed, it can be quickly identified and fed back whether there is a loop sequence in the current process route and which nodes constitute the loop sequence. BRIEF DESCRIPTION OF DRAWINGS
[0020] Figure 1 is a flow chart of a business sequence generation method for discrete manufacturing in the embodiment of the present application; Figure 2 is a first changed process route map in the embodiment of the present application; Figure 3 is a second changed process route map in the embodiment of the present application; Figure 4 is a third changed process route map in the embodiment of the present application; Figure 5 is a process route map before a change in an embodiment of the present application; Figure 6 is a process route map after a fourth change in an embodiment of the present application; Figure 7 is a process route map after a fifth change in an embodiment of the present application; Figure 8 is a process route including a loop sequence in an embodiment of the present application; Figure 9 is another business sequence generation method flow chart for discrete manufacturing in an embodiment of the present application; Figure 10 is a structural schematic diagram of a process sequence generation system for discrete manufacturing in an embodiment of the present application. DETAILED DESCRIPTION
[0021] As mentioned in the background, in the prior art, after the process route is changed, the similar manufacturing execution system (MES) or enterprise resource planning (ERP) system in the field of discrete manufacturing generates a business sequence according to the changed process route, needs to process a nonlinear generation process route with complex parallel branches and confluence relationships, receives an instruction for adding, deleting or modifying the correlation of a process procedure, calculates the topology logic between nodes in the process route in real time, and automatically maps to generate a business sequence number reflecting the production hierarchy relationship, but in actual application, the generation efficiency of the business sequence number is low.
[0022] The present inventors have found that the main reason is that in the prior art, when sorting the changed process route, the full amount of nodes in the process route needs to be recalculated every time a small change occurs in the procedure, and in the case of a long process route or large-scale concurrent modification, the calculation load is high. In addition, the sorting method in the prior art may cause unnecessary rearrangement of the procedure number that has not changed, affecting the sequence consistency of the downstream business system. Further, when the production manager changes the process route, he or she may inadvertently cause a "loop sequence" in the changed process route, i.e., a "dead loop", which will result in an incomplete business sequence being generated. In a dense nonlinear network process route, manually checking the loop sequence is time-consuming and directly affects the scheduling efficiency.
[0023] To this end, in the embodiment of the present application, by identifying the affected node set that needs to be modified in the changed process route, only the affected node set is sorted to obtain an affected subsequence. The remaining nodes in the changed process route are non-affected nodes, and the sorting of the non-affected nodes in the original service sequence is retained to obtain a non-affected subsequence. The affected subsequence and the non-affected subsequence are integrated to obtain a final service sequence. The number of nodes in the final service sequence is compared with the total number of nodes in the current process route. If they are inconsistent, it is determined that there is a loop sequence in the current process route, and the set of nodes that constitute the loop sequence is obtained according to the logical relationship between the nodes in the current process route. In this way, the efficiency of obtaining the service sequence is improved, and fast feedback is realized on whether there is a loop sequence after the change and which nodes constitute the loop sequence.
[0024] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0025] Figure 1 is a flowchart of a service sequence generation method for discrete manufacturing in an embodiment of the present application. The method can be applied to a manufacturing execution system (MES) or an enterprise resource planning (ERP) or other types of systems that need to adjust process routes in the field of discrete manufacturing. Referring to Figure 1 , the method includes steps S101 to S104, which will be described in detail below.
[0026] Step S101, obtaining an original service sequence before the change, and a current node set after the change, a logical relationship between the current nodes, and a change node set. The current nodes belong to the current node set, and the change node set is a subset of the current node set.
[0027] Step S102, obtaining an affected node set and a logical relationship between the affected nodes according to the logical relationship between the change node set and the current nodes, wherein the affected node set is at least a part of the current node set, and the affected nodes belong to the affected node set.
[0028] Step S103, if the proportion of the affected node set in the current node set is less than a preset threshold, sorting the affected nodes according to the logical relationship between the affected node set and the affected nodes to obtain an affected subsequence, wherein the node set in the affected subsequence is at least a part of the affected node set.
[0029] Step S104, extracting a non-affected subsequence from the original service sequence, and obtaining a final service sequence according to the affected subsequence and the non-affected subsequence.
[0030] In the implementation of step S101, the original business sequence before the process route is changed by the production manager is obtained, and the original business sequence is an ordered original node set. The changed node set is a set of all nodes on which the production manager performs a change operation when changing the process route. The current node set after the change is a set of all nodes in the current process route after the production manager completes the change operation. The current node belongs to the current node set, and the logical relationship between the current nodes refers to the connection relationship between each node and other nodes in the current process route.
[0031] Each node represents a process step in discrete manufacturing. The node set is a set formed by nodes, which includes at least one node. For example, the current node set contains all nodes after the change. The business sequence is a sequence formed by sorting nodes, which usually represents the execution order of each process step, and can include a serial sequence, a parallel sequence, or a combination of serial and parallel sequences. The logical relationship between the nodes represents the mutual logical dependency between the nodes in a given process route. For example, after the production manager completes the change operation on the process route, the mutual dependency between the nodes can be extracted in the modified process route.
[0032] In the implementation of step S102, after obtaining the original business sequence, the current node set, the logical relationship between the current nodes, and the changed node set, in the current node set, according to the logical relationship between the current nodes, starting from each node in the changed node set, the changed node set and the set of nodes obtained by backward traversal are taken as the affected node set, and the logical relationship between the affected nodes, i.e., the connection relationship between each affected node and other affected nodes in the current process route, is obtained. The affected node set is at least a part of the current node set, and the affected node belongs to the affected node set.
[0033] In the implementation of step S103, after obtaining the affected node set and the logical relationship between the affected nodes, it is first determined whether the proportion of the affected node set in the current node set is less than a preset threshold. If the proportion of the affected node set in the current node set is greater than or equal to the preset threshold, the current node set is fully sorted to obtain the final business sequence. The sorting method can use topological sorting, such as Kahn algorithm. The preset threshold can be, for example, 50%-60%.
[0034] If the proportion of the affected node set in the current node set is less than the preset threshold, only the affected node set is sorted to obtain the affected subsequence. The sorting method can use topological sorting, such as Kahn algorithm.
[0035] In a non-limiting example, Figure 2 A changed process route map for discrete manufacturing is shown, where nodes numbered 2, 3, and 4 are affected nodes. The three affected nodes are sorted by using Kahn algorithm, and the local in-degree values of the affected nodes are obtained. The affected node numbered 2 has no preceding affected node, and its local in-degree value is 0. The local in-degree value of the preceding affected node directly connected to the affected node numbered 3 is 0, so the local in-degree value of the affected node numbered 3 is 1. The local in-degree value of the preceding affected node directly connected to the affected node numbered 4 is 1, so the local in-degree value of the affected node numbered 4 is 2.
[0036] The three affected nodes are sorted according to the local in-degree values. First, the affected node with a local in-degree value of 0, i.e., the affected node numbered 2, is inserted into the affected subsequence. At this time, the local in-degree values of the remaining two affected nodes are updated. The local in-degree value of the affected node numbered 3 is 0, and the local in-degree value of the affected node numbered 4 is 1. Next, the affected node with a local in-degree value of 0, i.e., the affected node numbered 3, is inserted into the affected subsequence. At this time, the local in-degree value of the remaining affected node is updated. The local in-degree value of the affected node numbered 4 is 0. Finally, the affected node with a local in-degree value of 0, i.e., the affected node numbered 4, is inserted into the affected subsequence. The final affected subsequence is {2, 3, 4}. In the affected subsequence, the elements 2, 3, and 4 represent the nodes numbered 2, 3, and 4, respectively. The same representation is used hereinafter.
[0037] Further, the level information of each current node is obtained. The level information of a current node without a preceding node is set to 1. The level information of a current node is obtained by traversing the preceding current nodes directly connected to the current node and adding 1 to the maximum level information of the preceding current nodes. The level information of the current nodes numbered 1, 5, and 6 is 1. The level information of the affected node numbered 2 is 2. The level information of the affected node numbered 3 is 3. The level information of the affected node numbered 4 is 4. The level information is used to represent the level of a node in a business sequence. For example, if a node has no preceding node in a business sequence, its level information is 1. If a node has one preceding node in a business sequence, its level information is 2. If a node has two preceding nodes in a business sequence, its level information is 3. And so on.
[0038] In the implementation of step S104, after the affected node set is obtained, the set of the remaining nodes in the current node set after the affected node set is removed is the set of non-affected nodes. Since the non-affected nodes are the nodes in the process route that are not changed and do not need to be reordered, the original service sequence contains all the non-affected nodes and the order of each non-affected node before and after, thereby obtaining the non-affected sub-sequence. The affected sub-sequence and the non-affected sub-sequence are integrated to obtain the final service sequence.
[0039] In one embodiment, each node in the original service sequence has a respective number, which is generated when the original service sequence is generated, and the numbers of each node are different. Integrating the affected sub-sequence and the non-affected sub-sequence to obtain the final service sequence can include steps a to c, which are described in detail below.
[0040] Step a: Take out the first nodes of the affected sub-sequence and the non-affected sub-sequence, compare the level information and the numbers of the two nodes taken out, and determine the node to be inserted and insert it into the sequence according to the comparison result. The node to be inserted is one of the two nodes, and the other node is the remaining node. Step b: Take out the next node in the sub-sequence to which the node to be inserted belongs, compare the level information and the number of the remaining node and the next node taken out, update the node to be inserted and insert it into the sequence according to the comparison result, and update the remaining node. Repeat step b until the sequence contains all nodes in the non-affected sub-sequence. Step c: Insert the part of the affected sub-sequence that has not been taken out into the end of the sequence, and take the sequence as the final service sequence.
[0041] In the implementation of step a, after taking out the first nodes of the affected sub-sequence and the non-affected sub-sequence, the two nodes taken out are checked according to the logical relationship between the current nodes. If the node taken out in the non-affected sub-sequence is before the node taken out in the affected sub-sequence, the level information and the number of the two nodes taken out are compared.
[0042] Furthermore, if both nodes being compared contain numbers and have the same hierarchical information, then based on the order of the two nodes in the original business sequence, the node with the higher ranking is selected as the node to be inserted and inserted into the sequence. If the hierarchical information of the two nodes being compared is different, the node with the smaller hierarchical information is selected as the node to be inserted and inserted into the sequence. If the hierarchical information of the two nodes being compared is the same and both nodes contain unnumbered nodes, then the node containing numbers, i.e., the unaffected node, is selected as the node to be inserted and inserted into the sequence. When the change operation performed on the process route includes adding a new node, the newly added node is an unnumbered node without a number, and the unnumbered node is the affected node.
[0043] After performing the first round of comparisons on the first node in both the affected and unaffected subsequences, in the specific implementation of step b, the next node in the subsequence to which the node to be inserted belongs is taken out. The remaining nodes and the taken-out next node are verified according to the logical relationship between the current nodes. If, among the two nodes being verified, the node belonging to the unaffected subsequence precedes the node belonging to the affected subsequence, the hierarchical information and number of the remaining nodes and the taken-out next node are compared.
[0044] Furthermore, if both nodes being compared contain numbers and have the same hierarchical information, then based on the order of the two nodes in the original business sequence, the node with the higher ranking is selected as the node to be inserted and inserted into the sequence. If the hierarchical information of the two nodes being compared is different, the node with the smaller hierarchical information is selected as the node to be inserted and inserted into the sequence. If the hierarchical information of the two nodes being compared is the same and both nodes contain unnumbered nodes, then the node containing numbers, i.e., the unaffected node, is selected as the node to be inserted and inserted into the sequence. When the change operation performed on the process route includes adding a new node, the newly added node is an unnumbered node without a number, and the unnumbered node is the affected node.
[0045] In a non-restrictive example, each comparison involves two nodes, one from the affected subsequence and one from the unaffected subsequence. After obtaining and verifying the nodes to be compared, if the verification result indicates that the affected node is the predecessor node of the unaffected node, the affected node is directly inserted into the sequence. The next node of the affected node in the affected subsequence is then obtained and compared with the unaffected node in the next round.
[0046] In a non-restrictive example, such as Figure 3 As shown,Figure 3 Another changed process route for discrete manufacturing is provided, where the unnumbered node is a new node, and the ordering result of the original process route is [7, 11, 8, 9, 10]. After the new node is added, for example, after the production manager performs the new node operation on the original process route, the current node set obtained is {7, 11, 8, 9, 10, (unnumbered node)}, the logical relationship between the current nodes is {7:8; 11:8; 8:9; 9:10; (unnumbered node):9}, where the level information of the unnumbered node, node 7 and node 11 is 1, the level information of node 8 is 2, the level information of node 9 is 3, and the level information of node 10 is 4, the changed node set is {(unnumbered node)}, and for example, “7:8;” means that in the current process route, node 7 is connected to node 8, and node 7 is before node 8, the node after “:” indicates which nodes are connected to the node before “:”, and the node before “:” is before the node after “:”, and the logical relationship between different groups of nodes is separated by “;”. According to the logical relationship between the current nodes, starting from each node in the changed node set, the node set obtained by traversing backward in the current node set according to the logical relationship between the current nodes is {(unnumbered node), 9, 10}, and {(unnumbered node), 9, 10} is set as the affected node set. The affected node set is topologically sorted to obtain [(unnumbered node), 9, 10] as the affected subsequence, and [7, 11, 8] is obtained as the non-affected subsequence according to the original business sequence.
[0047] In order, the first nodes in the affected subsequence and the non-affected subsequence are taken, i.e. the node without number and the node 7, and according to the logical relationship between the current nodes, it is verified that the node without number is not the predecessor of the node 7, the node without number and the node 7 are compared, because the level information of the two nodes is the same and the node without number does not exist original number, the node 7 is inserted into the sequence, and the current sequence is [7]. Then the node 11 is taken, and according to the logical relationship between the current nodes, it is verified that the node without number is not the predecessor of the node 11, the node without number and the node 11 are compared, because the level information of the two nodes is the same and the node without number does not exist original number, the node 11 is inserted into the sequence, and the current sequence is [7, 11]. Then the node 8 is taken, and according to the logical relationship between the current nodes, it is verified that the node without number is not the predecessor of the node 8, the node without number and the node 8 are compared, because the level information of the two nodes is different, the level information of the node without number is smaller, and therefore the node without number is inserted, and the current sequence is [7, 11, (node without number)]. Then the node 9 is taken, and according to the logical relationship between the current nodes, it is verified that the node 9 is not the predecessor of the node 8, the node 8 and the node 9 are compared, because the level information of the two nodes is different, the level information of the node 8 is smaller, and therefore the node 8 is inserted, and the current sequence is [7, 11, (node without number), 8]. At this time, the nodes in the non-affected subsequence have been inserted into the sequence, and the remaining nodes in the affected subsequence are inserted into the end of the sequence according to their order in the affected subsequence, and the final service sequence is [7, 11, (node without number), 8, 9, 10]. In this way, the modification of the service sequence is minimized, unnecessary rearrangement of the process number (non-affected subsequence) that does not occur numbering is not required, the calculation amount in the service sequence generation process is reduced, and at the same time, by trying to keep the original service sequence, the stability of the business process is improved.
[0048] In one non-limiting example, as shown in Figure 4 Figure 4 Another changed process route for discrete manufacturing is provided, where the current node set is {12, 13, 14, 15, 16, 17, 18}, the logical relationship between the current nodes is {12:13, 14, 15; 13:18; 14:16; 16:18; 15:17; 17:18}, the hierarchical information of node 12 is 1, the hierarchical information of nodes 13, 14, and 15 is 2, the hierarchical information of nodes 16 and 17 is 3, and the hierarchical information of node 18 is 4. “12:13, 14, 15;” indicates that the nodes connected with node 12 include node 13, node 14, and node 15, and node 12 is before node 13, node 14, and node 15. The original service sequence is [12, 13, 14, 15, 16, 17, 18], and the production manager adjusts the original process route by modifying the content of node 14, so the changed node set is {14}. According to the logical relationship between the current nodes, starting from each node in the changed node set, the nodes set obtained by traversing backward in the current node set according to the logical relationship between the current nodes is {14, 16, 18}, {14, 16, 18} is set as the affected node set, the affected node set is topologically sorted, the affected subsequence is [14, 16, 18], and the unaffected subsequence is [12, 13, 15, 17] according to the original service sequence.
[0049] Take the first node in the affected subsequence and the non-affected subsequence in order, that is, take node 14 and node 12, and check according to the logical relationship between the current nodes to obtain that node 14 is not the predecessor of node 12, compare node 14 and node 12, because the hierarchical information of the two nodes is different, the hierarchical information of node 12 is smaller, insert node 12 into the sequence, and the current sequence is
[12] . Take node 13 again, check according to the logical relationship between the current nodes to obtain that node 14 is not the predecessor of node 13, compare node 14 and node 13, because the hierarchical information of the two nodes is the same and contains the number, insert node 13 into the sequence according to the order in the original service sequence, and the current sequence is [12, 13]. Take node 15 again, check according to the logical relationship between the current nodes to obtain that node 14 is not the predecessor of node 15, compare node 14 and node 15, because the hierarchical information of the two nodes is the same and contains the number, insert node 14 into the sequence according to the order in the original service sequence, and the current sequence is [12, 13, 14]. Take node 16 again, check according to the logical relationship between the current nodes to obtain that node 16 is not the predecessor of node 15, compare node 16 and node 15, because the hierarchical information of the two nodes is different, insert node 15 with smaller hierarchical information into the sequence, and the current sequence is [12, 13, 14, 15]. Take node 17 again, check according to the logical relationship between the current nodes to obtain that node 16 is not the predecessor of node 17, compare node 16 and node 17, because the hierarchical information of the two nodes is the same and contains the number, insert node 16 into the sequence according to the order in the original service sequence, and the current sequence is [12, 13, 14, 15, 16]. Take node 18 again, check according to the logical relationship between the current nodes to obtain that node 18 is not the predecessor of node 17, compare node 18 and node 17, because the hierarchical information of the two nodes is different, insert node 17 with smaller hierarchical information into the sequence, and the current sequence is [12, 13, 14, 15, 16, 17]. At this time, the nodes in the non-affected subsequence have been inserted into the sequence, and the remaining nodes in the affected subsequence are inserted into the end of the sequence according to their order in the affected subsequence, and the final service sequence is [12, 13, 14, 15, 16, 17, 18].
[0050] In one non-limiting example, as shown in Figure 5 Figure 5 Another pre-change process route for discrete manufacturing is provided, as shown in Figure 6 Figure 6 A pre-change process route for discrete manufacturing is provided by Figure 5 The process route after the process route execution change operation in the process route, wherein the current node set is {19, 23, 24, 20, 22}, the logical relationship between the current nodes is {19:20; 23:20; 20:22; 24:22}, and the level information of nodes 19, 23, and 24 is 1, the level information of node 20 is 2, and the level information of node 22 is 3. The original service sequence is [19, 23, 24, 20, 21, 22], the production manager adjusts the original process route, deletes node 21, and adjusts the connection relationship of node 24, so the changed node set is {20, 24, 22}. According to the logical relationship between the current nodes, each node in the changed node set is traversed in the current node set according to the logical relationship between the current nodes, and the node set obtained is {20, 24, 22}. The {20, 24, 22} is set as the affected node set, the topological sorting is performed on the affected node set, the affected subsequence [24, 20, 22] is obtained, and the non-affected subsequence [19, 23] is obtained according to the original service sequence.
[0051] The first nodes in the affected subsequence and the non-affected subsequence are taken in sequence, that is, node 24 and node 19, the logical relationship between the current nodes is checked to obtain that node 24 is not the predecessor of node 19, node 24 and node 19 are compared, because the level information of the two nodes is the same and both contain the number, the sorting of node 19 is obtained according to the original service sequence, and node 19 is inserted into the sequence, and the current sequence is
[19] . Node 23 is taken, the logical relationship between the current nodes is checked to obtain that node 24 is not the predecessor of node 23, node 24 and node 23 are compared, because the level information of the two nodes is the same and both contain the number, the sorting of node 23 is obtained according to the original service sequence, and node 23 is inserted into the sequence, and the current sequence is [19, 23]. At this time, the nodes in the non-affected subsequence have been inserted into the sequence, and the remaining nodes in the affected subsequence are inserted into the end of the sequence in the order in the affected subsequence, and the final service sequence is [19, 23, 24, 20, 22].
[0052] In one non-limiting example, as shown in FIG. 8, Figure 7 Figure 7 Another changed process route for discrete manufacturing is provided, wherein the current node set is {25, 26, 27, 28, 29, 30, 31}, the logical relationship between the current nodes is {25:27; 27:26; 26:28; 29:31, 30:31; 31:28}, wherein the level information of nodes 25, 29, and 30 is 1, the level information of nodes 27 and 31 is 2, the level information of node 26 is 3, and the level information of node 28 is 4. The original business sequence is [25, 29, 30, 26, 31, 27, 28], and the production manager adjusts the original process route by exchanging the front and back order of nodes 26 and 27, so the changed node set is {25, 27, 26, 28}. According to the logical relationship between the current nodes, starting from each node in the changed node set, traversing backward in the current node set according to the logical relationship between the current nodes, the node set obtained is {25, 27, 26, 28}, {25, 27, 26, 28} is set as the affected node set, the affected node set is topologically sorted, and [25, 27, 26, 28] is obtained as the affected subsequence, and [29, 30, 31] is obtained as the non-affected subsequence according to the original business sequence.
[0053] The first nodes in the affected subsequence and the non-affected subsequence are taken in order, i.e., node 25 and node 29, and it is verified according to the logical relationship between the current nodes that node 25 is not the predecessor of node 29. Node 25 and node 29 are compared, because the level information of the two nodes is the same and both contain a number, and according to the original service sequence, node 25 is sorted earlier, node 25 is inserted into the sequence, and the current sequence is
[25] . Node 27 is taken, and it is verified according to the logical relationship between the current nodes that node 27 is not the predecessor of node 29. Node 27 and node 29 are compared, because the level information of the two nodes is different, and node 29 with smaller level information is inserted into the sequence, and the current sequence is [25, 29]. Node 30 is taken, and it is verified according to the logical relationship between the current nodes that node 27 is not the predecessor of node 30. Node 27 and node 30 are compared, because the level information of the two nodes is different, and node 30 with smaller level information is inserted into the sequence, and the current sequence is [25, 29, 30]. Node 31 is taken, and it is verified according to the logical relationship between the current nodes that node 27 is not the predecessor of node 31. Node 27 and node 31 are compared, because the level information of the two nodes is the same and both contain a number, and according to the order in the original service sequence, node 31 is sorted earlier, node 31 is inserted into the sequence, and the current sequence is [25, 29, 30, 31]. At this time, the nodes in the non-affected subsequence have been inserted into the sequence, and the remaining nodes in the affected subsequence are inserted into the end of the sequence in order in the affected subsequence, and the final service sequence is [25, 29, 30, 31, 27, 26, 28].
[0054] In one non-limiting example, after obtaining the final service sequence, the number of nodes in the current node set and the final service sequence is compared. If they are not consistent, it is determined that there is at least one set of loop nodes in the current node set. The loop nodes are obtained according to the logical relationship between the current nodes and the current node set. Refer to Figure 8 , Figure 8 A process route containing a loop sequence for discrete manufacturing is shown, and all nodes in the current process route are topologically sorted, in which the in-degree value of nodes 32 and 34 is 0, the in-degree value of node 33 is 1, and the in-degree value of nodes 35 and 36 is 2. The nodes with an in-degree value of 0 are preferentially pushed into the stack, i.e., nodes 32 and 34 are pushed into the stack, at this time the in-degree value of node 33 is 0, and the in-degree value of nodes 35 and 36 is 2. The nodes with an in-degree value of 0 are again pushed into the stack, i.e., node 33 is pushed into the stack, at this time the in-degree value of nodes 35 and 36 is 1. It is detected that there is no node with an in-degree value of 0, and the sorting is stopped. At this time, the service sequence obtained only contains three nodes, while the current node set contains five nodes, and it is determined that there is a loop sequence in the current process route.
[0055] According to the logical relationship between the current nodes, traversal can be performed using a depth-first search algorithm (DFS). First, node 32 is pushed into the stack, then node 33 is pushed into the stack, then node 35 is pushed into the stack, and then node 36 is pushed into the stack. At this time, node 35 is pushed into the stack again. It is detected that node 35 is already included in the stack [32, 33, 35, 36]. The traversal ends, and [35, 36, 35] is taken as the final loop sequence. The loop nodes included in the loop sequence include node 35 and node 36.
[0056] In one non-limiting example, as shown in FIG. 8, the embodiment of the present application provides another method flowchart for generating a business sequence for discrete manufacturing. The method includes steps S901 to S909, which are described in detail below. Figure 9
[0057] Step S901: Obtain an original business sequence, a current node set, a logical relationship between current nodes, and a changed node set.
[0058] Step S902: Obtain an affected node set and a logical relationship between affected nodes according to the current node set and the logical relationship between the current nodes.
[0059] Step S903: Determine whether the proportion of the affected node set in the current node set is less than a preset threshold. If the determination result is yes, perform step S904; if the determination result is no, perform step S906.
[0060] Step S904: Sort the affected node set, and jump to step S905.
[0061] Step S905: Extract a non-affected subsequence from the original business sequence, integrate the non-affected subsequence and the affected subsequence, and jump to step S907.
[0062] Step S906: Sort the current node set, and jump to step S907.
[0063] Step S907: Obtain a final business sequence, and jump to step S908.
[0064] Step S908: Determine whether the number of nodes in the final business sequence is consistent with the number of nodes in the current node set. If the determination result is yes, end the processing; if the determination result is no, perform step S909.
[0065] Step S909: Traverse using a depth-first search algorithm according to the logical relationship between the current nodes, and extract loop nodes.
[0066] Steps S901 to S902 can correspond to steps S101 to S102 in FIG. 1. Figure 1 In the case that the step S903 judges that the result is yes, the process of the step S904 can correspond to the step S103, and the steps S905 and S907 can correspond to the step S104, which will not be described in detail here.
[0067] As shown in FIG. 1, Figure 10 The embodiment of the present application further provides a business sequence generation system 100 for discrete manufacturing, which comprises: A data acquisition module 101 is configured to acquire an original business sequence before change, and a current node set, a logical relationship between current nodes and a change node set after change, wherein the current nodes belong to the current node set, and the change node set is a subset of the current node set; a node acquisition module 102 is configured to acquire a logical relationship between an affected node set and affected nodes according to the logical relationship between the change node set and the current nodes, wherein the affected node set is at least a part of the current node set, and the affected nodes belong to the affected node set; a sorting module 103 is configured to sort the affected nodes according to the logical relationship between the affected node set and the affected nodes, and acquire an affected sub-sequence, if a proportion of the affected node set in the current node set is less than a preset threshold, wherein a node set in the affected sub-sequence is at least a part of the affected node set; and a sequence integration module 104 is configured to extract an unaffected sub-sequence from the original business sequence, and acquire a final business sequence according to the affected sub-sequence and the unaffected sub-sequence.
[0068] The embodiment of the present application further provides a computer readable storage medium, which is a non-volatile storage medium or a non-transient storage medium, and has a computer program stored thereon, wherein the computer program is run by a processor to execute the steps of the business sequence generation method for discrete manufacturing provided in any of the above embodiments. Preferably, the storage medium can include a computer readable storage medium such as a non-volatile memory or a non-transitory memory. The storage medium can include a ROM, a RAM, a magnetic disk or an optical disk, etc.
[0069] The embodiment of the present application further provides a computer program product, which includes a computer program, and the computer program is run by a processor to implement the steps of the business sequence generation method for discrete manufacturing provided in any of the above embodiments.
[0070] The embodiment of the present application further provides an electronic device, which includes a memory and a processor, and the memory has a computer program stored thereon, which can be run on the processor, and the processor runs the computer program to execute the steps of the business sequence generation method for discrete manufacturing provided in any of the above embodiments.
[0071] Those skilled in the art can understand that all or part of the steps of various methods in the above embodiments can be completed by instructing the relevant hardware through programs, and the programs can be stored in a computer readable storage medium, which can include ROM, RAM, magnetic disk or optical disk, etc.
[0072] Although the present application is disclosed as above, it is not limited to the above. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present application, and the protection scope of the present application should be defined by the scope of the claims.
Claims
1. A method for generating business sequences in discrete manufacturing, characterized in that, include: Obtain the original business sequence before the change, as well as the current node set, the logical relationship between the current nodes, and the changed node set after the change, wherein the current node belongs to the current node set, and the changed node set is a subset of the current node set; Based on the logical relationship between the changed node set and the current node, the logical relationship between the affected node set and the affected node is obtained, wherein the affected node set is at least a part of the current node set, and the affected node belongs to the affected node set; If the proportion of the affected node set in the current node set is less than a preset threshold, the affected nodes are sorted according to the affected node set and the logical relationship between the affected nodes to obtain an affected subsequence, wherein the set of nodes in the affected subsequence is at least a part of the affected node set; Unaffected subsequences are extracted from the original business sequence, and the final business sequence is obtained from the affected subsequences and the unaffected subsequences.
2. The business sequence generation method for discrete manufacturing according to claim 1, characterized in that, The method further includes: If the number of nodes in the current node set is not consistent with the number of nodes in the final business sequence, it is determined that there is at least one component point in the current node set. The constituent nodes are obtained based on the logical relationships between the current nodes and the set of current nodes.
3. The business sequence generation method for discrete manufacturing according to claim 1, characterized in that, Each current node contains its hierarchical information. Each node in the original service sequence has its own number and hierarchical information. The final service sequence is obtained based on the affected subsequence and the unaffected subsequence, including: Step a: Take out the first node of the affected subsequence and the unaffected subsequence, compare the hierarchical information and number of the two taken nodes, determine the node to be inserted according to the comparison result and insert it into the sequence, wherein the node to be inserted is one of the two nodes and the other of the two nodes is the remaining node; Step b: Take out the next node in the subsequence to which the node to be inserted belongs, compare the hierarchical information and number of the remaining nodes and the taken next node, update the node to be inserted according to the comparison result and insert it into the sequence, and update the remaining nodes; Repeat step b until the sequence contains all nodes from the unaffected subsequence; Step c: Insert the unremoved portion of the affected subsequence into the end of the sequence, and use the sequence as the final business sequence.
4. The business sequence generation method for discrete manufacturing according to claim 3, characterized in that, The step of extracting the first node of the affected subsequence and the first node of the unaffected subsequence, and comparing the hierarchical information and number of the two extracted nodes, includes: The two extracted nodes are verified based on the logical relationship between the current nodes. If a node taken from the unaffected subsequence precedes a node taken from the affected subsequence, then the hierarchical information and number of the two taken nodes are compared.
5. The business sequence generation method for discrete manufacturing according to claim 3, characterized in that, The step of retrieving the next node from the subsequence to which the node to be inserted belongs, and comparing the hierarchical information and number of the remaining nodes with that of the retrieved next node, includes: The remaining nodes and the next node to be extracted are verified based on the logical relationship between the current nodes. If, among the two nodes being verified, the node belonging to the unaffected subsequence precedes the node belonging to the affected subsequence, then the hierarchical information and number of the remaining node and the next node to be extracted are compared.
6. The business sequence generation method for discrete manufacturing according to claim 3, characterized in that, The step of determining or updating the node to be inserted based on the comparison result and inserting it into the sequence includes: In response to the fact that both nodes being compared contain the number and have the same hierarchical information, the node with the higher ranking in the original business sequence is selected as the node to be inserted and inserted into the sequence according to the ranking of the two nodes in the original business sequence.
7. The business sequence generation method for discrete manufacturing according to claim 3, characterized in that, The affected node set includes a newly added node, which does not contain the aforementioned number. The original business sequence does not contain the newly added node. The step of determining or updating the node to be inserted based on the comparison result and inserting it into the sequence includes: In response to the existence of the new node and the same hierarchical information in the two nodes currently being compared, the unaffected node in the two nodes is selected as the node to be inserted and inserted into the sequence.
8. The business sequence generation method for discrete manufacturing according to claim 3, characterized in that, The step of determining or updating the node to be inserted based on the comparison result and inserting it into the sequence includes: In response to the fact that the hierarchical information of the two nodes currently being compared is different, the node with the smaller hierarchical information is selected as the node to be inserted and inserted into the sequence.
9. A business sequence generation system for discrete manufacturing, characterized in that, include: The data acquisition module is used to acquire the original business sequence before the change, as well as the current node set, the logical relationship between the current nodes, and the changed node set after the change. The current nodes belong to the current node set, and the changed node set is a subset of the current node set. The node acquisition module is used to acquire the logical relationship between the affected node set and the affected nodes based on the logical relationship between the changed node set and the current node, wherein the affected node set is at least a part of the current node set, and the affected nodes belong to the affected node set; The sorting module sorts the affected nodes according to the logical relationship between the affected nodes and the affected nodes if the proportion of the affected node set in the current node set is less than a preset threshold, thereby obtaining an affected subsequence, wherein the set of nodes in the affected subsequence is at least a part of the affected node set. The sequence integration module extracts unaffected sub-sequences from the original business sequence and obtains the final business sequence based on the affected sub-sequences and the unaffected sub-sequences.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the business sequence generation method for discrete manufacturing as described in any one of claims 1 to 8.
11. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the business sequence generation method for discrete manufacturing as described in any one of claims 1 to 8.
12. An electronic device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor runs the computer program, it performs the steps of the business sequence generation method for discrete manufacturing as described in any one of claims 1 to 8.