Unit scheduling method, device and equipment and storage medium
By encapsulating flight sub-rules into function interfaces and optimizing the calling order, the problem of low flight scheduling efficiency in the crew automatic scheduling system is solved, and efficient flight orchestration is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA SOUTHERN AIRLINES DIGITAL TECHNOLOGY (GUANGDONG) CO LTD
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-21
AI Technical Summary
The automatic flight scheduling system requires repeated calls to complex flight sub-rules when planning flight schedules, resulting in low flight scheduling efficiency.
Different flight sub-rules are encapsulated into different function interfaces and the call values are configured. Flight rule checks are optimized through function interface arrays and dependencies, reducing the number of function interface calls and improving rule execution efficiency.
By reducing the number of function interface calls, the efficiency of flight scheduling has been improved, meeting the flight arrangement needs of the crew.
Smart Images

Figure CN121903569A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, equipment and storage medium for unit scheduling. Background Technology
[0002] The automated crew scheduling system is a crew scheduling planning system that plans crew schedules by constructing objective functions and constraints. When planning crew schedules, all proposed plans must first pass compliance checks to ensure the accuracy of crew flight planning. These checks include rules such as "crew members meet the requirements," "crew flight time does not exceed the upper limit," and "crew rest time is not less than the lower limit."
[0003] It is evident that when the automated crew scheduling system plans flight assignments for each crew member, it needs to check each flight sub-rule individually based on the crew member's employee information to determine the flight information that matches the crew member, thereby planning flights for them. This process generates a large number of rule checking operations. Because flight sub-rules are quite complex and overlap between them, checking different flight sub-rules requires repeatedly calling different flight sub-rules, resulting in low flight scheduling efficiency. Summary of the Invention
[0004] This application provides a method, apparatus, equipment, and storage medium for flight crew scheduling to improve flight scheduling efficiency.
[0005] To achieve the above objectives, this application adopts the following technical solution: Firstly, this application provides a crew scheduling method, which includes: obtaining an array of function interfaces for flight sub-rules; the function interface array includes multiple function interfaces, each function interface corresponding to a flight sub-rule. When a first function interface in the function interface array is called, the call value corresponding to the first function interface is obtained; the first function interface is any one of the multiple function interfaces. When the call value is a first numerical value, a first adaptation result corresponding to the first function interface is obtained; the first numerical value is the value of the first function interface that has been called, and the adaptation result is the first adaptation result obtained by adapting the employee information of the crew members based on the flight sub-rule corresponding to the first function interface. Flights are scheduled for the crew members based on the first adaptation result.
[0006] The above technical solution offers at least the following benefits: It encapsulates different flight sub-rules into different function interfaces. Furthermore, it configures a call value for the first function interface. Thus, after the first function interface is called, its call value is updated to a first value. Subsequently, if the first function interface needs to be called again, given its call value is the first value, the first adaptation result of the first function interface is directly reused, allowing flight scheduling for the crew based on that first adaptation result. This eliminates the need to call the first function interface again, reducing the number of function interface calls and improving rule execution efficiency. This, in turn, improves flight scheduling efficiency.
[0007] In one possible implementation, the method further includes: when the call value is a second value, adapting the flight sub-rule corresponding to the first function interface based on the employee information to obtain a first adaptation result, and updating the call value to the first value; the second value is a value that the first function interface has not been called.
[0008] In one possible implementation, obtaining the call value corresponding to the first function interface includes: Based on the first function interface and the function interface dependencies, the second function interface that the first function interface depends on is determined; the function interface dependencies are used to characterize the dependencies between different function interfaces in the function interface array; the second function interface is the function interface in the function interface array other than the first function interface; Based on employee information, the flight sub-rules corresponding to the second function interface are adapted to obtain the second adaptation result. If the second adaptation result meets the flight scheduling requirements of the crew, obtain the call value corresponding to the first function interface.
[0009] In one possible implementation, the process of determining the function interface array includes: Multiple function interfaces are obtained by scanning the flight sub-rules in the flight rule information decision table; different tables in the flight rule information decision table correspond to different flight sub-rules. Multiple function interfaces are marked, and a function interface array is determined based on the marked function interfaces.
[0010] In one possible implementation, the method also includes: Generate a cache array of function interface call results based on the function interface array; the function interface call value cache array contains multiple function interface call results, with one function interface corresponding to one function interface call value.
[0011] In one possible implementation, each function interface in the array of function interfaces is a function interface of type boolean (bool).
[0012] Secondly, this application provides a crew scheduling device, which includes an acquisition unit and a processing unit.
[0013] The acquisition unit is used to acquire the array of function interfaces for flight sub-rules; the array of function interfaces includes multiple function interfaces, and one function interface corresponds to one flight sub-rule.
[0014] The acquisition unit is also used to acquire the call value corresponding to the first function interface when the first function interface is in the array of function interfaces; the first function interface is any one of the multiple function interfaces.
[0015] The acquisition unit is also used to acquire the first adaptation result corresponding to the first function interface when the call value is the first numerical value; the first numerical value is the value that the first function interface has been called, and the adaptation result is the first adaptation result obtained by adapting the employee information of the crew members based on the flight sub-rules corresponding to the first function interface.
[0016] The processing unit is used to schedule flights for the crew based on the first adaptation result.
[0017] In one possible implementation, the unit scheduling device also includes an update unit.
[0018] The processing unit is also used to adapt the flight sub-rule corresponding to the first function interface based on the employee information when the call value is the second value, so as to obtain the first adaptation result.
[0019] The update unit is used to update the called value to the first value; the second value is the value of the first function interface that has not been called.
[0020] In one possible implementation, the unit is obtained, specifically for: Based on the first function interface and the function interface dependencies, the second function interface that the first function interface depends on is determined; the function interface dependencies are used to characterize the dependencies between different function interfaces in the function interface array; the second function interface is the function interface in the function interface array other than the first function interface.
[0021] Based on employee information, the flight sub-rules corresponding to the second function interface are adapted to obtain the second adaptation result.
[0022] If the second adaptation result meets the flight scheduling requirements of the crew, obtain the call value corresponding to the first function interface.
[0023] In one possible implementation, the unit scheduling device also includes a determination unit.
[0024] The determination unit is used to: scan the flight sub-rules in the flight rule information decision table to obtain multiple function interfaces; different tables in the flight rule information decision table correspond to different flight sub-rules; mark the multiple function interfaces, and determine the function interface array based on the marked multiple function interfaces.
[0025] In one possible implementation, the unit scheduling device also includes a generation unit.
[0026] The generation unit is used to generate a cache array of function interface call results based on the function interface array; wherein, the cache array of function interface call values includes multiple function interface call results, with one function interface corresponding to one function interface call value.
[0027] In one possible implementation, each function interface in the array of function interfaces is a function interface of type boolean (bool).
[0028] Thirdly, this application provides an electronic device comprising: a processor and a communication interface; the communication interface and the processor are coupled, the processor being configured to run computer programs or instructions to implement the crew scheduling method as described in the first aspect and any possible implementation thereof.
[0029] Fourthly, this application provides a computer-readable storage medium storing instructions that, when executed on a terminal, cause the terminal to perform the crew scheduling method as described in the first aspect and any possible implementation thereof.
[0030] Fifthly, this application provides a computer program product containing instructions that, when run on a network optimization strategy determination device, causes the network optimization strategy determination device to execute the crew scheduling method as described in the first aspect and any possible implementation thereof.
[0031] Sixthly, this application provides a chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run computer programs or instructions to implement the crew scheduling method as described in the first aspect and any possible implementation of the first aspect.
[0032] Specifically, the chip provided in this application also includes a memory for storing computer programs or instructions. Attached Figure Description
[0033] Figure 1 A schematic diagram of a crew scheduling system provided in this application embodiment; Figure 2 A schematic diagram of a dependency graph provided for an embodiment of this application; Figure 3 A schematic diagram of a merge planning tree provided for an embodiment of this application; Figure 4 A schematic diagram illustrating the composition of an electronic device provided in an embodiment of this application; Figure 5 A flowchart illustrating a crew scheduling method provided in this application embodiment; Figure 6 This is a schematic diagram of the unit scheduling device provided in the embodiments of this application. Detailed Implementation
[0034] The method, apparatus, and storage medium for determining network optimization strategies provided in the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0035] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0036] The terms "first" and "second," etc., used in the specification and drawings of this application are used to distinguish different objects or to distinguish different treatments of the same object, rather than to describe a specific order of objects.
[0037] Furthermore, the terms "comprising" and "having," and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.
[0038] It should be noted that in the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0039] In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0040] The automated crew scheduling system is a flight planning system for crew members. It plans crew flights by constructing objective functions and constraints. When planning crew flights, all proposed plans must first pass compliance checks to ensure the accuracy of the flight planning. These checks include rules such as "crew members meet the requirements," "crew flight time does not exceed the upper limit," and "crew rest time is not less than the lower limit."
[0041] It is evident that when the automated crew scheduling system plans flight assignments for each crew member, it needs to check each flight sub-rule individually based on the crew member's employee information to determine the flight information that matches the crew member, thereby planning flights for the crew. Because the flight sub-rules are complex and overlap, checking them requires repeatedly calling different flight sub-rules, resulting in low flight scheduling efficiency.
[0042] For example, consider a large airline with 1000 pilots (N) and 2000 flights per day. To schedule pilots for a month, the number of flights would reach 60,000 (M). When the automated crew scheduling system manages crew personnel, it constructs an employee network graph for each pilot. Specifically, it first checks the matching rules between each pilot and each flight task. Only flight tasks that meet the rules are added to the corresponding graph, becoming a node. This process is called node rule processing. After node rule processing, it checks the connection rules between any two nodes in the graph. If they are valid, an edge is constructed between the two nodes. This process is called edge rule processing.
[0043] Simultaneously, each graph constructs a virtual start point and a virtual end point. All nodes that can be the first departing flight are connected to the virtual start point, and all nodes that can be the last landing flight are connected to the virtual end point. This completes the construction of the pilot network graph. Thus, a legal path from the virtual start point to the virtual end point in the pilot network graph is a feasible work path for the crew members. The rule checks at this stage can be called path rule checks. Therefore, the number of checks for point rules is N×M=60 million. Assuming each graph has 10,000 legal nodes after point rules, the number of edge rule calls is 10,000×10,000×1000=100 billion. For path rules, the number of rule checks is astronomical. It can be seen that the rule check data of the automatic crew scheduling system is automatically generated internally, leading to a combinatorial explosion problem. However, under normal circumstances, the system needs to complete the checks quickly. Traditional rule engine solutions are inefficient and struggle to handle such large-scale data processing and rule matching.
[0044] In view of this, this application provides a crew scheduling method, which includes: obtaining an array of function interfaces for flight sub-rules. The function interface array includes multiple function interfaces, with each function interface corresponding to one flight sub-rule. When a first function interface in the function interface array is called, the call value corresponding to the first function interface is obtained; the first function interface is any one of the multiple function interfaces. When the call value is a first numerical value, a first adaptation result corresponding to the first function interface is obtained. The first numerical value is the value of the first function interface that has been called, and the adaptation result is the first adaptation result obtained by adapting the employee information of the crew members based on the flight sub-rule corresponding to the first function interface. Flights are scheduled for the crew members based on the first adaptation result.
[0045] The above technical solution offers at least the following benefits: It encapsulates different flight sub-rules into different function interfaces. Furthermore, it configures a call value for the first function interface. Thus, after the first function interface is called, its call value is updated to a first numerical value. Subsequently, if the first function interface needs to be called again, given that its call value is the first numerical value, the first adaptation result of the first function interface is directly reused, thereby scheduling flights for the crew based on the first adaptation result. This eliminates the need to call the first function interface again, reducing the number of function interface calls and improving rule execution efficiency. This, in turn, improves flight scheduling efficiency.
[0046] For example, Figure 1 This is a schematic diagram of the structure of a crew scheduling system 10 provided in an embodiment of this application. The crew scheduling system 10 may include a processing module 101 and a cache module 102. The processing module 101 and the cache module 102 are connected.
[0047] The processing module 101 is used to scan the flight sub-rules in the flight rule information decision table to obtain multiple function interfaces; different tables in the flight rule information decision table correspond to different flight sub-rules, and the multiple function interfaces are marked, and the function interface array is determined based on the marked multiple function interfaces.
[0048] For example, the flight rules information decision table may include Table 1 below.
[0049] Table 1: Flight Rule Information Decision Table
[0050] In Table 1 above, T indicates true, meaning the person is qualified to fly; F indicates false, meaning the person is not qualified to fly.
[0051] Specifically, the flight rule information decision table can be a tabular collection of flight sub-rule logics, with each table representing a single flight rule. A flight sub-rule refers to a local logic within the flight rule information decision table (e.g., the content contained in a cell in Table 1 above: "Task string.type == 'Flight'"). Each flight sub-rule can exist in two forms: a function interface and an expression, and all flight sub-rules are configured to return a boolean value. The interface-based processing of flight sub-rules involves encapsulating all expressions of flight sub-rules with a function interface: converting them to a boolean function interface (e.g., bool fun1() { return Task string.type == "Flight"). This standardized processing provides a unified processing unit for subsequent flight rule information decision table conversions. Furthermore, the unified function interface format makes the reuse, invocation, and logical modification of flight sub-rules controllable, providing a stable carrier for the logical mapping of code generation in the crew automatic dispatching system.
[0052] The processing module 101 is also used to obtain all function interfaces (including those derived from expressions) by scanning the decision table and store them in a function interface array `void* funcPtr[n]`. Here, `n` represents the number of function interfaces, each array index corresponds to a function interface number, and the array elements are function pointers. Simultaneously, another function interface call value cache array `ret[n]` is created. Here, `n` in the function interface call value cache array is the number of function interfaces, the array index is the function interface identifier (identity, ID), and the call value of each array element represents the call result of the corresponding function interface. For example, the call value can include the following three values: -1, 0, and 1. Here, -1 indicates that the interface has not been called, and 0 / 1 indicates that it has been called and a corresponding call result has been obtained.
[0053] In addition, because some interface results in the function interface array have dependencies (e.g., the "Pilot Qualification" function interface needs to be calculated based on the "Pilot Current Rank" function interface result), the processing module 101 is also used to sort out the dependencies between function interfaces and determine the calling order of function interfaces, thereby avoiding logical errors.
[0054] Processing module 101 is specifically used to perform the following operations: S1. Scan the logical definitions of all function interfaces and extract the dependencies between them. Further, create a dependency list for each function interface to record its required prerequisite function interfaces (e.g., add the "Pilot's Current Rank" function interface ID to the dependency list of the "Pilot Qualification" interface).
[0055] S2. Construct a directed graph of function interface dependencies: Using function interface ID as a node, if function interface A depends on interface B, draw a directed edge from function interface B to function interface A to form a dependency graph.
[0056] S3. Perform topological sorting of function interface relationships: Use algorithms such as Kahn's algorithm to perform topological sorting to obtain the correct calculation order of function interfaces.
[0057] Subsequently, the processing module 101 is also used to check the call values of the function interfaces sequentially according to the topological sorting results during the call to the function interfaces. If ret[id] is -1, the interface is called and ret[id] is updated; if it is 0 or 1, the result is directly reused.
[0058] For example, with Figure 2 As shown, a dependency graph is illustrated. Figure 2 The graph includes dependency relationships for 11 function interfaces: ID1, ID2, ID3, ID5, ID6, ID7, ID8, ID9, ID10, and ID11.
[0059] based on Figure 2 If you need to call the ID5 function interface to get the adaptation result, then you need to... Figure 2 The dependency graph shows that the function interface for ID11 is called first, then the function interface for ID8 is called, and then the function interface for ID5 is called. For example, if the function interface for ID2 needs to be called, then it needs to be determined according to... Figure 2 The function interface dependencies in the code require calling the function interfaces of ID11, ID8, and ID5. If the function interfaces of ID11, ID8, and ID5 have already been called and their adaptation results saved, the adaptation results can be obtained directly. This avoids the same function interface being called repeatedly, ensures the correctness of the calculation order of dependent interfaces, and further improves the efficiency of rule execution.
[0060] Understandably, the processing module 101 generates a function interface array, a function interface call value cache array, and function interface dependencies based on the flight rule information decision table.
[0061] Processing module 101 is also used to expand and merge the flight sub-rules of the flight rule information decision table.
[0062] Specifically, the flight sub-rule expansion process is as follows: Considering readability, the flight rule information decision table uses merged cells to simplify the rule structure, which corresponds to a nested if statement structure in the code. Directly parsing merged cell rules is equivalent to parsing the cell relationships in the table. Considering the complexity of the merged cell scheme, a cell expansion approach can be adopted. For example, all flight sub-rules can be expanded so that each row of cells corresponds to an if condition, thus avoiding complex nested condition structures. Since all flight sub-rules have been converted into a unified function interface during the preprocessing stage, flight sub-rule expansion only requires indexing and copying based on the function interface ID, without needing to handle differences between different forms of flight sub-rules, simplifying the expansion logic of the flight rule information decision table. Through the flight sub-rule expansion processing operation in the flight rule information decision table, the flight rule information decision table can be intuitively converted into code form simply by traversing the table. However, the drawback of this approach is that it generates a large number of duplicate sub-rules, leading to unnecessary repeated calls during execution.
[0063] For example, the flight sub-rule cell table is shown in Table 2 below, and the expanded flight sub-rule cell table is shown in Table 3 below.
[0064] Table 2: Flight Sub-rule Unit Table
[0065] Table 3: Expanded Flight Sub-rule Unit Table
[0066] Combining Tables 2 and 3 above, when expanding the flight sub-rules, "Condition 1" changes from one to two, increasing the number of repeated calls. Since the correct rule logic can be obtained by traversing all sub-rules in matrix order, as shown in Tables 2 and 3, traversing Condition 1, Condition 2, and Condition 4 yields a TRUE result; traversing Condition 1, Condition 3, and Condition 4 yields a FALSE result.
[0067] The flight sub-rule merging process is as follows: Since the flight rule information decision table uses a matrix-style data management table structure, to facilitate the conversion of flight sub-rules into function codes, the flight sub-rules in the flight rule information decision table are first expanded to obtain function codes. Then, the function codes are analyzed to merge identical flight sub-rules, thus resolving the duplication problem caused by duplicate flight sub-rules after expansion. Because a unique function interface ID has been assigned to each flight sub-rule during the preprocessing stage, the merging process can directly determine whether two sub-rules are the same through the function interface ID, without needing to parse the internal logic of the rules. This makes the merging algorithm simple and efficient.
[0068] The specific implementation is as follows: Each flight sub-rule (function interface ID) is treated as an independent node. A complete flight sub-rule then constitutes a tree. A path from the root node to a leaf node represents a branch condition, and the leaf node is the return value of that branch. Starting from the root node, the tree is traversed level by level. If two nodes A and B at the same level have the same incoming edges, and the outgoing sub-rule lists of node A and B are identical, then node B is deleted, and its outgoing node list is added to node A's outgoing edge list. By merging sub-rules layer by layer in this way, a simplified rule logic tree is obtained. At this point, only a level-wise traversal of the rule tree is needed to generate the corresponding nested conditional logic.
[0069] For example, the planning tree before merging is as follows: Figure 3 As shown in (a), it includes the root node, two conditions 1, and a list of sub-rules 1 corresponding to each condition 1. Figure 3 (a) The planning trees before merging are merged to obtain the merged planning tree as shown below. Figure 3 As shown in (b), it includes the root node, a condition 1, a sub-rule list 1, and the relationship between the sub-rule list 1.
[0070] The processing module 101 is also used to, when converting the flight rule information decision table into code, not directly generate function interface call code, but first determine whether an interface needs to be called based on the function interface dependency relationship, function interface call value cache array, and function interface array input by the preprocessing module. Specifically, it iterates through the interfaces according to the topological sorting result in the function interface dependency relationship. If the function interface call value is the second value, then the function interface is called, and the adaptation result (call result) is stored, and the function interface call value is set to the first value. If the function interface call value is the first value, then the adaptation result (call result) of that function interface is directly adopted.
[0071] In this embodiment, during the development phase of the automatic unit scheduling system, the focus is on the intuitive presentation of the rule logic, reducing performance requirements and facilitating rule writing, debugging, and modification by rule developers, thereby improving development efficiency. However, during the operation phase of the automatic unit scheduling system, the focus is on executing a large number of rule checking tasks, requiring extremely high performance.
[0072] Specifically, during the development phase, a flight rule information decision table is selected as the flight rule development tool. Its underlying foundation is the dynamically typed language Lua, thus enabling interactive debugging during development. Developers can adjust flight sub-rule parameters in real time and immediately observe the execution results of flight sub-rules under different input conditions. This is extremely beneficial for quickly locating and resolving problems in the rule logic, accelerating the rule debugging process, and effectively ensuring the efficiency of rule iteration. Developers can respond promptly to changes in business requirements, quickly adjust and optimize rules, and improve overall development efficiency.
[0073] When entering the operational phase, considering the extremely high performance requirements of aviation operations, using a C++ dynamic library is the better choice. As a statically compiled language, C++ has significant advantages in execution efficiency, particularly when facing large-scale rule checking tasks. To achieve a smooth transition between the development and operational phases, a specialized conversion mechanism is needed. The aforementioned method for converting flight sub-rules in the flight rule information decision table is universal, and the function interface and interface list scanning in the preprocessing phase provide a unified intermediate layer for this universal conversion—regardless of whether the target output is Lua or C++, it is based on the same interface units and execution logic. Therefore, it supports bidirectional conversion between Lua and C++, allowing different technical solutions to be used in the development and operational phases to address different needs at different stages. This ensures compatibility with both modes of rule execution; Lua is used in the development phase to support debugging and hot updates, while the runtime phase converts to a C++ dynamic library, efficiently solving the performance and development efficiency issues associated with high-frequency calls.
[0074] The caching module 102 is used to cache the call values corresponding to the function interfaces, the function interface array, the function interface call value cache array, and the function interface dependency relationships.
[0075] In some embodiments, the crew scheduling system 10 is applied to electronic devices.
[0076] Figure 4 This is a schematic diagram illustrating the composition of an electronic device 40 provided in an embodiment of this application. The electronic device 40 can be a computing device or a chip or system-on-a-chip within a computing device. Alternatively, the electronic device 40 can be a base station or a chip or system-on-a-chip within a base station. Figure 4 As shown, the electronic device 40 may include a processor 401 and a bus 402.
[0077] Furthermore, the electronic device 40 may also include a communication interface 403 and a memory 404. The processor 401, memory 404, and communication interface 403 can be connected via a bus 402.
[0078] The processor 401 can be a CPU, a general-purpose processor, a network processor (NP), a digital signal processor (DSP), a microprocessor, a microcontroller, a programmable logic device (PLD), or any combination thereof. The processor 401 can also be other devices with processing capabilities, such as circuits, devices, or software modules, without limitation.
[0079] Bus 402 is used to transmit information between the components included in electronic device 40.
[0080] Communication interface 403 is used to communicate with other devices or other communication networks. These other communication networks can be Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc. Communication interface 403 can be a module, circuit, communication interface, or any device capable of enabling communication.
[0081] Memory 404 is used to store instructions. These instructions can be computer programs.
[0082] The memory 404 can be a read-only memory (ROM) or other type of static storage device that can store static information and / or instructions; it can also be a random access memory (RAM) or other type of dynamic storage device that can store information and / or instructions; it can also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, etc., without limitation.
[0083] It should be noted that the memory 404 can exist independently of the processor 401, or it can be integrated with the processor 401. The memory 404 can be used to store instructions, program code, or some data, etc. The memory 404 can be located inside or outside the electronic device 40, without restriction.
[0084] In one example, processor 401 may include one or more CPUs, for example, Figure 4CPU0 and CPU1 (not shown in the figure).
[0085] As an optional implementation, the electronic device 40 includes multiple processors.
[0086] As an optional implementation, electronic device 40 also includes output devices and input devices (not shown in the figure). For example, input devices are devices such as keyboards, mice, microphones, or joysticks, and output devices are devices such as displays and speakers.
[0087] It should be noted that electronic device 40 can be a desktop computer, laptop computer, network server, mobile phone, tablet computer, wireless terminal, embedded device, chip system, or something else. Figure 4 Equipment with a similar structure. Furthermore... Figure 4 The various devices may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0088] In this embodiment of the application, the chip system may be composed of chips or may include chips and other discrete devices.
[0089] Furthermore, the actions, terms, etc., involved in the various embodiments of this application can be referenced interchangeably without limitation. The message names or parameter names in the messages used for interaction between devices in the embodiments of this application are merely examples, and other names may be used in specific implementations without limitation.
[0090] The following is combined with Figure 1 The illustrated crew scheduling system 10 describes the crew scheduling method provided in this application embodiment. The actions, terminology, etc., involved in the various embodiments of this application can be referenced interchangeably without limitation. The message names or parameter names in the messages exchanged between various devices in the embodiments of this application are merely examples; other names may be used in specific implementations without limitation. The actions involved in the various embodiments of this application are merely examples; other names may be used in specific implementations. For example, "included in" in the embodiments of this application can be replaced with "carried in" or "carried in," etc.
[0091] like Figure 5 As shown, this is a crew scheduling method provided in an embodiment of the present application, which includes: S501-S504.
[0092] S501, Obtain the array of function interfaces for flight sub-rules.
[0093] The function interface array includes multiple function interfaces, and each function interface corresponds to a flight sub-rule.
[0094] In some embodiments, when performing flight scheduling tasks, the electronic device obtains an array of function interfaces for flight sub-rules.
[0095] For example, an array of function interfaces may include 100 function interfaces.
[0096] Each function interface in the array above is of type boolean (bool). These multiple function interfaces run in a C++ dynamic library.
[0097] S502. If the first function interface in the function interface array is called, obtain the call value corresponding to the first function interface.
[0098] The first function interface is any one of the multiple function interfaces.
[0099] In some embodiments, when the electronic device obtains employee information of the crew members who need to be scheduled for flights, it determines the first function interface in the function interface array based on the employee information. Further, the electronic device obtains the call value corresponding to the first function interface.
[0100] For example, taking a total crew size of 1000, the electronic device obtains the personnel information of the i-th crew member, determines the first function interface to be called based on the personnel information of the i-th crew member, and obtains the call value corresponding to the first function interface.
[0101] The aforementioned personnel information may include age, gender, type of grounding, and type of flight permitted.
[0102] In this embodiment, the crew's personnel information and function interface array are used to adapt to the crew's airworthiness information, thereby arranging flight tasks for the crew based on the airworthiness information.
[0103] S503. If the call value is the first value, obtain the first adaptation result corresponding to the first function interface.
[0104] The first value is the value that the first function interface has been called, and the adaptation result is the first adaptation result obtained by adapting the employee information of the crew members based on the flight sub-rules corresponding to the first function interface.
[0105] In some embodiments, when an electronic device obtains the call value of a first function interface, it determines whether the call value is a first value, and if the call value is a first value, it obtains the first adaptation result corresponding to the first function interface.
[0106] For example, taking a first value of 0 or 1 as an example. When the electronic device determines that the first value is 1, it determines that the first function interface has been called during the flight compatibility check process for the current crew. Further, the electronic device retrieves the first compatibility result of the first function interface from the cache module.
[0107] The first matching result mentioned above can represent the flight information that the crew can match, the no-fly flight information for the crew, or the accommodation needs information for the crew. This application does not limit this aspect.
[0108] S504. Based on the first adaptation result, schedule flights for the crew.
[0109] In this embodiment of the application, the electronic device, upon obtaining the adaptation results of different function interfaces, determines the airworthiness requirements of the crew members based on the different adaptation results, thereby scheduling flights for the crew members.
[0110] In one design, the unit scheduling method provided in this application embodiment further includes: S505-S506.
[0111] S505. When the call value is the second value, adapt the flight sub-rule corresponding to the first function interface based on the employee information to obtain the first adaptation result.
[0112] The second value is the value of the first function interface that has not been called.
[0113] In some embodiments, when the electronic device determines that the call value is a second value, it calls the first function interface to obtain a first adaptation result (call result).
[0114] For example, the second value is -1. When the electronic device determines that the call value is -1, it adapts the flight sub-rule corresponding to the first function interface based on the no-fly type in the employee information to obtain the first adaptation result.
[0115] S506. Update the called value to the first value.
[0116] For example, taking a first value of 1 as an example, the electronic device updates the call value of the first function interface to 1, caches the updated call value of the first function interface in the cache module, and caches the first adaptation result of the first function interface in the cache module.
[0117] Understandably, this function interface is invoked when it is not currently being called. Furthermore, after invoking the function interface, its call value is updated, and both the call value and the adaptation result are cached. Subsequently, if the same crew member needs to call the function interface again, the adaptation result is retrieved from the cache.
[0118] In one design, the above S502 includes: S5021-S5023.
[0119] S5021. Based on the first function interface and the function interface dependency relationship, determine the second function interface that the first function interface depends on.
[0120] Among them, the function interface dependency relationship is used to characterize the dependency relationship between different function interfaces in the function interface array; the second function interface is the function interface in the function interface array other than the first function interface.
[0121] The number of the aforementioned second function interfaces can be one or more, and this application embodiment does not limit this. For example, when an electronic device determines that it needs to call the first function interface, it determines that the first function interface depends on three function interfaces based on the first function interface and the function interface dependencies.
[0122] S5022. Based on employee information, adapt the flight sub-rules corresponding to the second function interface to obtain the second adaptation result.
[0123] In some embodiments, the electronic device calls a second function interface based on employee information to adapt the flight sub-rules corresponding to the second function interface and obtain a second adaptation result.
[0124] Specifically, when there are multiple second function interfaces, the electronic device calls the second function interfaces sequentially according to their dependency paths.
[0125] In another scenario, if it is determined that a second function interface will be called, the call value of the second function interface is obtained. If the call value of the second function interface is a first value, the second adaptation result corresponding to the second function interface is reused. If the call value of the second function interface is a second value, the second function interface is called, and after calling the second function interface, its call value is updated to the first value. Furthermore, the electronic device caches the call value of the second function interface and the second adaptation result.
[0126] S5023. If the second adaptation result meets the flight scheduling requirements of the crew, obtain the call value corresponding to the first function interface.
[0127] The above flight scheduling requirements can be true.
[0128] In some embodiments, the process of determining the above-mentioned function interface array includes: obtaining multiple function interfaces by scanning the flight sub-rules in the flight rule information decision table; different tables in the flight rule information decision table correspond to different flight sub-rules. The multiple function interfaces are marked, and the function interface array is determined based on the marked multiple function interfaces.
[0129] In one design, the unit scheduling method provided in this application embodiment further includes: S507.
[0130] S507. Generate a function interface call result cache array based on the function interface array; wherein, the function interface call value cache array includes multiple function interface call results, and one function interface corresponds to one function interface call value.
[0131] The crew scheduling method provided in this application provides at least the following beneficial effects: Obtaining an array of function interfaces for flight sub-rules. The function interface array includes multiple function interfaces, each corresponding to a flight sub-rule. When calling the first function interface in the array, obtaining the call value corresponding to the first function interface; the first function interface can be any one of the multiple function interfaces. When the call value is a first numerical value, obtaining the first adaptation result corresponding to the first function interface. The first numerical value is the value of the first function interface that has been called, and the adaptation result is the first adaptation result obtained by adapting the employee information of the crew members based on the flight sub-rule corresponding to the first function interface. Flights are scheduled for the crew members based on the first adaptation result.
[0132] It is understood that the above-mentioned crew scheduling method can be implemented by a crew scheduling device. To achieve the above functions, the crew scheduling device includes the corresponding hardware structure and / or software modules for executing each function. Those skilled in the art should readily recognize that, based on the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, the embodiments disclosed in this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can utilize different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments disclosed in this application.
[0133] The embodiments disclosed in this application can divide the unit scheduling device generated by the above method examples into functional modules. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in the embodiments disclosed in this application is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0134] For example, Figure 6 The unit scheduling device 60 provided in the embodiments of this application includes: an acquisition unit 601 and a processing unit 602.
[0135] The acquisition unit 601 is used to acquire the function interface array of the flight sub-rule; the function interface array includes multiple function interfaces, and one function interface corresponds to one flight sub-rule.
[0136] The acquisition unit 601 is also used to acquire the call value corresponding to the first function interface when the first function interface is in the array of function interfaces; the first function interface is any one of the multiple function interfaces.
[0137] The acquisition unit 601 is also used to acquire the first adaptation result corresponding to the first function interface when the call value is the first value; the first value is the value that the first function interface has been called, and the adaptation result is the first adaptation result obtained by adapting the employee information of the crew members based on the flight sub-rules corresponding to the first function interface.
[0138] Processing unit 602 is used to schedule flights for the crew based on the first adaptation result.
[0139] In one possible implementation, such as Figure 6 As shown, the unit scheduling device 60 also includes an update unit 603.
[0140] The processing unit 602 is also used to adapt the flight sub-rule corresponding to the first function interface based on the employee information when the call value is the second value, so as to obtain the first adaptation result.
[0141] Update unit 603 is used to update the called value to the first value; the second value is the value of the first function interface that has not been called.
[0142] In one possible implementation, the acquisition unit 601 is specifically used for: Based on the first function interface and the function interface dependencies, the second function interface that the first function interface depends on is determined; the function interface dependencies are used to characterize the dependencies between different function interfaces in the function interface array; the second function interface is the function interface in the function interface array other than the first function interface.
[0143] Based on employee information, the flight sub-rules corresponding to the second function interface are adapted to obtain the second adaptation result.
[0144] If the second adaptation result meets the flight scheduling requirements of the crew, obtain the call value corresponding to the first function interface.
[0145] In one possible implementation, such as Figure 6 As shown, the unit scheduling device 60 also includes a determination unit 604.
[0146] The determining unit 604 is used to: scan multiple function interfaces obtained from flight sub-rules in the flight rule information decision table; different tables in the flight rule information decision table correspond to different flight sub-rules; mark multiple function interfaces, and determine a function interface array based on the marked multiple function interfaces.
[0147] In one possible implementation, such as Figure 6 As shown, the unit scheduling device 60 also includes a generation unit 605.
[0148] The generation unit 605 is used to generate a function interface call result cache array based on the function interface array; wherein, the function interface call value cache array includes multiple function interface call results, and one function interface corresponds to one function interface call value.
[0149] In one possible implementation, each function interface in the array of function interfaces is a function interface of type boolean (bool).
[0150] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0151] This disclosure also provides a computer-readable storage medium storing instructions that, when executed by a processor of an electronic device, enable the electronic device to perform the method for determining network optimization strategies provided in the embodiments of this disclosure described above.
[0152] This disclosure also provides a computer program product containing instructions that, when run on an electronic device, causes the electronic device to execute the method for determining the network optimization strategy provided in the above-described embodiments of this disclosure.
[0153] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires; a portable computer disk drive; a hard disk drive; a random access memory (RAM); a read-only memory (ROM); an erasable programmable read-only memory (EPROM); a register; a hard disk drive; an optical fiber; a portable compact disc read-only memory (CD-ROM); an optical storage device; a magnetic storage device; or any suitable combination thereof; or any other form of computer-readable storage medium known in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may reside in an application-specific integrated circuit (ASIC). In the embodiments of this application, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0154] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A unit scheduling method, characterized in that, The method includes: Obtain the array of function interfaces for flight sub-rules; the array of function interfaces includes multiple function interfaces, and one function interface corresponds to one flight sub-rule; When the first function interface in the array of function interfaces is called, the call value corresponding to the first function interface is obtained; the first function interface is any one of the plurality of function interfaces. When the call value is a first numerical value, the first adaptation result corresponding to the first function interface is obtained; the first numerical value is the value of the first function interface being called, and the adaptation result is the first adaptation result obtained by adapting the employee information of the crew members based on the flight sub-rules corresponding to the first function interface. Flights are scheduled for the crew members based on the first adaptation result.
2. The unit scheduling method according to claim 1, characterized in that, The method further includes: When the call value is the second value, the flight sub-rule corresponding to the first function interface is adapted based on the employee information to obtain the first adaptation result, and the call value is updated to the first value; the second value is a value that the first function interface has not been called.
3. The unit scheduling method according to claim 1, characterized in that, The step of obtaining the call value corresponding to the first function interface includes: Based on the first function interface and the function interface dependency relationship, a second function interface that the first function interface depends on is determined; the function interface dependency relationship is used to characterize the dependency relationship between different function interfaces in the function interface array; the second function interface is a function interface in the function interface array other than the first function interface; Based on the employee information, the flight sub-rules corresponding to the second function interface are adapted to obtain the second adaptation result. If the second adaptation result meets the flight scheduling requirements of the crew, the call value corresponding to the first function interface is obtained.
4. The unit scheduling method according to claim 1, characterized in that, The process of determining the function interface array includes: The multiple function interfaces obtained by scanning the flight sub-rules in the flight rule information decision table; different tables in the flight rule information decision table correspond to different flight sub-rules; The plurality of function interfaces are marked, and the array of function interfaces is determined based on the marked plurality of function interfaces.
5. The unit scheduling method according to claim 4, characterized in that, The method further includes: A function interface call result cache array is generated based on the function interface array; wherein, the function interface call value cache array includes multiple function interface call results, and one function interface corresponds to one function interface call value.
6. The unit scheduling method according to any one of claims 1-5, characterized in that, Each function interface in the array of function interfaces is a boolean function interface.
7. A unit scheduling device, characterized in that, The device includes: an acquisition unit and a processing unit; The acquisition unit is used to acquire an array of function interfaces for flight sub-rules; the array of function interfaces includes multiple function interfaces, and one function interface corresponds to one flight sub-rule; The acquisition unit is further configured to acquire the call value corresponding to the first function interface when the first function interface in the function interface array is called; the first function interface is any one of the plurality of function interfaces; The acquisition unit is further configured to acquire a first adaptation result corresponding to the first function interface when the call value is a first numerical value; the first numerical value is the value of the first function interface being called, and the adaptation result is the first adaptation result obtained by the first function interface adapting the employee information of the crew members based on the flight sub-rules corresponding to the first function interface. The processing unit is used to schedule flights for the crew members based on the first adaptation result.
8. The unit scheduling device according to claim 7, characterized in that, The device further includes: an update unit; The processing unit is further configured to, when the call value is a second value, adapt the flight sub-rule corresponding to the first function interface based on the employee information to obtain the first adaptation result; The update unit is used to update the call value to the first value; the second value is a value that the first function interface has not been called.
9. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the method as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, When the computer-executable instructions stored in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is capable of performing the method as described in any one of claims 1 to 6.