A method and system for training and simulating scheduling strategies based on ITU rules.
By parsing ITU rule documents to generate structured data and knowledge graphs, a satellite communication frequency and orbit resource scheduling strategy model was trained and transformed. This solved the problem of model conversion between Python and C++ environments, and achieved consistency and accuracy in model output.
Patent Information
- Application Number
- CN202611320966.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-28
- Publication Date
- 2026-11-17
AI Technical Summary
In satellite communication frequency and track resource scheduling, existing technologies struggle to reliably acquire structured ITU rule data, leading to differences in execution logic and output deviations when the frequency and track resource scheduling strategy model is converted between Python and C++ environments. Furthermore, it is difficult to verify the model's consistency under changing rule conditions.
The ITU rules document is parsed to generate structured rule tuples and knowledge graphs. A frequency track resource scheduling simulation environment is built, a Python scheduling strategy model is trained, and it is converted into a C++ scheduling strategy model through an intermediate representation. The consistency of the model output is verified using standardized simulation data.
The frequency and track resource scheduling strategy model has been stably converted and verified in different environments, ensuring the consistency of the model's output under rule changes, reducing differences in execution logic, and improving the accuracy and reliability of the scheduling strategy.
Smart Images

Figure CN123114993A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of frequency and track resource scheduling technology, and in particular to a method and system for training and simulating scheduling strategies based on ITU rules. Background Technology
[0002] With the development of satellite communication technology, frequency and orbital resources in satellite communication systems need to be rationally configured and scheduled under different services, regions, and operating conditions. Due to the wide coverage and complex frequency resource usage relationships inherent in satellite communication, the use of relevant frequency and orbital resources typically needs to comply with the requirements of the International Telecommunication Union (ITU) regulations. The ITU Radio Regulations contain a large amount of content relating clauses, services, frequency bands, and regions, and this content is usually recorded in natural language and various document formats. When scheduling satellite communication frequency and orbital resources, if the scheduling simulation program directly reads the rule documents, it is difficult to reliably obtain structured rule data suitable for frequency and orbital resource configuration; especially when multiple applicable conditions are involved in the same frequency range, the applicability relationships between rules may be difficult to determine, and the scheduling program may find it difficult to directly execute the corresponding rules.
[0003] As the complexity of frequency and track resource scheduling scenarios increases, a frequency and track resource scheduling simulation environment can be established, and corresponding scheduling strategy models can be obtained through model training. These scheduling strategy models can typically be developed and trained in a Python environment, evaluating and selecting candidate frequency resources or other candidate scheduling actions based on the current simulation state. However, in actual deployment or simulation verification, the scheduling strategy model may need to be migrated to a C++ execution environment. Converting a Python scheduling strategy model to a C++ execution environment requires handling dynamic variable types, runtime attributes, conditional branches, tensor operations, and model weights. Relying solely on static source code analysis or ordinary running samples for model conversion may result in some conditional branches and runtime parameters not being fully obtained, potentially leading to differences in execution logic between the converted C++ model and the original Python model.
[0004] Furthermore, for frequency and track resource scheduling governed by ITU rules, the applicable status of these rules may change with variations in frequency ranges, service types, applicable regions, or other rule conditions. Consequently, the corresponding scheduling strategy model may execute different processing paths. If the model conversion process does not adequately cover these rule-changing conditions, even if the converted C++ model can be compiled and run normally, it is difficult to determine whether it maintains the same processing results as the original Python scheduling strategy model under the rule boundary conditions.
[0005] Furthermore, the converted C++ scheduling strategy model may be affected by factors such as input format, data precision, tensor arrangement, or differences in operator implementation, leading to output deviations. Existing verification methods for converted models struggle to perform targeted cross-environment comparisons for rule changes in frequency and orbit resource scheduling. Therefore, it is necessary to provide a method that can convert ITU rules into rule data usable for satellite communication frequency and orbit resource scheduling, and that can complete scheduling strategy model training, Python model conversion to C++ execution environment, and cross-environment simulation verification. Summary of the Invention
[0006] The main purpose of this application is to provide a method and system for training and simulating scheduling strategies based on ITU rules, aiming to solve at least one of the above-mentioned technical problems.
[0007] To achieve the above objectives, this invention provides a method for training and simulating scheduling strategies based on ITU rules, the method comprising the following steps: Parse the ITU rules document to obtain the rule-related data; A frequency track resource scheduling simulation environment is constructed based on the rule-related data, and a Python scheduling strategy model is trained in the frequency track resource scheduling simulation environment. The Python scheduling strategy model is subjected to runtime information parsing and code structure parsing. The corresponding parsing results are merged into an intermediate representation, and a C++ scheduling strategy model is generated based on the intermediate representation. The Python scheduling strategy model and the C++ scheduling strategy model are run using the same standardized simulation data, and simulation verification results are generated based on the differences in model output and preset thresholds.
[0008] To achieve the above objectives, the present invention also provides a scheduling strategy training and simulation verification system based on ITU rules, comprising: The rule processing module is used to parse ITU rule documents and obtain rule-related data; The strategy training module is used to construct a frequency track resource scheduling simulation environment based on the rule-related data, and to train a Python scheduling strategy model in the frequency track resource scheduling simulation environment. The model conversion module is used to parse the runtime information and code structure of the Python scheduling strategy model, merge the corresponding parsing results into an intermediate representation, and generate a C++ scheduling strategy model based on the intermediate representation. The simulation verification module is used to run the Python scheduling strategy model and the C++ scheduling strategy model using the same standardized simulation data, and generate simulation verification results based on the differences in model output and preset thresholds.
[0009] One or more technical solutions proposed in this application have at least the following technical effects: This application extracts entities, standardizes data, and associates text units in the ITU rules document, enabling the clause relationships in the rules document to be transformed into structured rule tuples, rule applicable data, and rule knowledge graphs. This facilitates the frequency track resource scheduling simulation program to read the rule content according to a unified data name.
[0010] When the frequency ranges corresponding to the candidate applicable data overlap, this application forms the rule application order and executable rule results according to the actual matching results of the rule conditions, so that rule content with different applicable scopes can be converted into data that can be directly compared by the scheduler.
[0011] This application marks the allowed states of candidate scheduling actions by using a feasible scheduling action matrix, and makes the training program select only the candidate scheduling actions corresponding to the allowed states, thereby reducing the number of actions that do not meet the rule conditions from entering the model training process, and preserving the correspondence between scheduling actions and rule applicable identifiers.
[0012] This application generates rule boundary data based on the location where the state of the candidate scheduling action is allowed to change, and uses the rule boundary data to run a Python scheduling strategy model, so that the model execution path and running attributes corresponding to the rule change conditions can be recorded, thereby improving the coverage of condition branches by the running information parsing.
[0013] This application aligns the parsed data with the static structure data obtained from the parsing of the abstract syntax tree, and records the relationship between Python source code nodes, intermediate representation operations, target interfaces and C++ code segments through a code mapping table, so that code generation, compilation location and problem code segment correction use the same correspondence.
[0014] This application uses the same standardized simulation data to run Python scheduling strategy models and C++ scheduling strategy models, and compares the model outputs according to the boundary condition categories, which can centrally verify the consistency of cross-environment outputs when the applicable state of the rules changes. Attached Figure Description
[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a flowchart illustrating the scheduling strategy training and simulation verification method based on ITU rules in this application. Figure 2 This is a schematic diagram illustrating the principle of generating and using the feasible scheduling action matrix in this application; Figure 3 This is a schematic diagram illustrating the principle of model parsing driven by rule boundary data in this application; Figure 4 This is a schematic diagram illustrating the principle of standardized simulation data generation and model verification in this application; Figure 5 This is a schematic diagram illustrating the frequency range relationship in a specific example of this application; Figure 6 This is a schematic diagram of the candidate scheduling action states in a specific example of this application; Figure 7 This is an example of the code mapping between Python source code nodes and C++ code segments in a specific example of this application; Figure 8 This is a schematic diagram of the module structure of the scheduling strategy training and simulation verification system based on ITU rules in this application.
[0018] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0019] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0020] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0021] The main solution of this invention is as follows: Parse the ITU rule document to obtain rule-related data; construct a frequency track resource scheduling simulation environment based on the rule-related data, and train a Python scheduling strategy model in the frequency track resource scheduling simulation environment; perform runtime information parsing and code structure parsing on the Python scheduling strategy model, merge the corresponding parsing results into an intermediate representation, and generate a C++ scheduling strategy model based on the intermediate representation; run the Python scheduling strategy model and the C++ scheduling strategy model using the same standardized simulation data, and generate simulation verification results based on the model output differences and preset thresholds.
[0022] The ITU rules document referred to in this embodiment can be either ITU radio rules text stored in Markdown format or rule text that has been converted to a format that can be read by a parsing program. The scheduling strategy model referred to in this embodiment is a neural network model that receives simulation status data and outputs scheduling action evaluation data or scheduling result data in a frequency and track resource scheduling simulation scenario.
[0023] It should be noted that the execution entity in this embodiment can be a computing device with capabilities for document parsing, model training, model conversion, program compilation, and simulation execution, or it can be a computing system composed of multiple computing nodes. The computing device can read rule documents, model source code, model weights, and simulation data through a local storage interface, and call model services or other computing nodes through a communication interface.
[0024] Based on this, embodiments of the present invention provide a method for training and simulating scheduling strategies based on ITU rules. For example... Figure 1 As shown, in this embodiment, the scheduling strategy training and simulation verification method based on ITU rules includes steps S100 to S400.
[0025] Step S100: Parse the ITU rules document to obtain the rules-related data.
[0026] In this embodiment, step S100 includes: reading the ITU rule document and converting it into plain text; extracting rule entity data from the plain text according to a preset matching rule, unifying the frequency unit and text format of the rule entity data and deleting duplicates to obtain normative entity data, wherein the rule entity data includes clause entities, business entities, frequency band entities and regional entities; combining the normative entity data according to the co-occurrence relationship of entities within the same text unit to obtain structured rule tuples; generating rule application data and rule knowledge graphs based on the structured rule tuples, and using the structured rule tuples, the rule application data and the rule knowledge graphs as rule association data.
[0027] When reading ITU rule documents, the parsing program first determines the document format and then retrieves the document's character content according to the corresponding reading interface. When the ITU rule document is in Markdown format, the parsing program can convert the Markdown content into HTML content and then read the text nodes from the HTML content. Heading symbols, emphasis marks, link symbols, and other typographical characters are removed during the conversion process, while clause numbers, service names, frequency expressions, and area expressions are retained.
[0028] It should be noted that the parsing program retains the original paragraph boundaries, sentence ends, and list levels when removing formatting characters. Paragraph boundaries and sentence ends are used to subsequently divide text units, and list levels are used to identify whether a rule condition continues to apply to adjacent text content. If all characters were directly concatenated into a single continuous string, it might cause invalid combinations of entities located in different clauses or paragraphs. Therefore, the plain text needs to retain delimiting information that reflects the original context.
[0029] In one executable implementation, the parser calls a document reading function to obtain Markdown character content, converts the character content into HTML, and then uses a text node extraction function to generate plain text. For documents that cannot be directly converted, they can first be converted to Markdown or plain text format. The conversion method can be selected based on the actual document format, as long as the converted plain text retains the rule entities and their contextual relationships.
[0030] Specifically, the system extracts rule entity data from plain text according to preset matching rules. Clause entities correspond to rule clause numbers or chapter numbers, service entities correspond to the names of radio services recorded in ITU rules, frequency band entities correspond to single frequencies or frequency ranges, and region entities correspond to the regions where the rules apply. The preset matching rules can be implemented using regular expressions, and the matching formats for Chinese and English expressions can be set according to the document language version.
[0031] For example, clause entities can match "Article 10" or clause numbers with multiple levels of numbers; frequency band entities can match expressions consisting of numerical values, range connectors, and frequency units; and area entities can match area codes, English area names, or global expressions. The matching vocabulary for business entities can be built based on the standardized business names used in ITU rules, and consistency in matching is improved through uniform character case, full-width characters, and spaces.
[0032] The system standardizes the extracted rule entity data. For frequency band entities, the system converts different frequency units to preset frequency units and saves the start and end values of the frequency intervals. For example, 1GHz in the document can be converted to 1000000000Hz. For clause entities, business entities, and region entities, the system standardizes spaces, character formats, and naming conventions. The system also removes duplicates according to entity category, standardized value, and text position to obtain standardized entity data.
[0033] As is easily understood, the frequency values converted to standard frequency units are used for subsequent interval comparisons, while the original frequency text can still be stored as source content in the structured data. Therefore, when the simulation program uses the standardized frequency values for comparison, the rule knowledge graph and query interface can still display the original expression from the rule document. The standardized values and the original values maintain a correspondence through the same entity identifier.
[0034] Furthermore, the step of combining the standardized entity data according to the co-occurrence relationship of entities within the same text unit to obtain a structured rule tuple includes: dividing the plain text into text units according to paragraph boundaries or sentence ending positions, and locating the rule entity data and rule condition data in each text unit; binding the rule entity data and rule condition data in the same text unit to obtain candidate applicable data; when the frequency ranges of multiple candidate applicable data overlap, comparing the exception condition matching results, business usage level, rule version effective order, and frequency range inclusion relationship to obtain the rule application order; generating rule applicable data and executable rule results according to the rule application order, and writing the rule applicable data and executable rule results into a structured rule tuple.
[0035] In this embodiment, a text unit can be a paragraph or a statement defined by a statement terminator. The system selects the granularity of the text unit based on the layout structure of the rule document. When a paragraph contains multiple independent rule relationships, statements are preferred as text units; when a rule condition extends to multiple short sentences in a list format, the corresponding list items and their parent content can be combined into a text unit.
[0036] The system records the start and end positions of the specified entity data and the entity category in each text unit, and reads the rule condition descriptions representing allowances, restrictions, priorities, exceptions, effective times, or applicable scopes. Rule condition data can be stored in the form of fields and values. For example, conditions representing a regional scope are written in the regional condition field, content indicating the start time of rule version application is written in the version condition field, and content indicating applicability after meeting a specific state is written in the exception condition field.
[0037] In practical applications, the number of fields in the rule condition data can be set according to the content of the rule document being processed. For condition fields not recorded in the document, the system can record them as empty values or preset default states. Empty values indicate that the current text unit has not added any restrictions to the condition. The specific meaning of the default state is uniformly defined by the rule parsing configuration file, thereby avoiding different interpretations of missing conditions by different processing programs.
[0038] The system binds clause entities, business entities, frequency band entities, and regional entities within the same text unit to rule condition data, generating candidate applicable data. Each candidate applicable data item has a candidate data identifier and records the source clause, business name, frequency range, applicable region, rule condition, and original text location.
[0039] When a text unit contains multiple entities of the same category, the system can create combinations based on character distance, conjunctions, and sentence structure between the entities. If multiple business entities correspond to the same frequency range and the same region, candidate applicable data can be created for each business entity separately; if the rule text explicitly indicates that multiple businesses are applicable together, the common applicability relationship can also be recorded in the candidate applicable data.
[0040] When the frequency ranges of multiple candidate applicable data overlap, the system first calculates the intersection range of each frequency range. If the intersection of two frequency ranges is empty, the corresponding candidate applicable data is retained; if the intersection range is greater than or equal to the preset minimum comparison range, the corresponding candidate applicable data is written into the same overlap processing set. The preset minimum comparison range can be set according to the frequency value precision.
[0041] The system compares the rules and conditions of candidate applicable data in the overlapping processing set. First, it reads the current target scheduling conditions and determines whether the exception conditions of each candidate applicable data are met. For candidate applicable data whose exception conditions are met, they are sorted according to the corresponding exception applicable content; for data whose exception conditions are not met, they are sorted according to their general applicable content.
[0042] After the exception condition comparison is completed, the system reads the service usage level and compares the order of different service usage levels according to a preset level relationship table. This preset level relationship table is configured by the simulation task and records each service usage level using standardized names. If the service usage levels of the candidate applicable data are the same, the system continues to compare the effective time or version order of the rule versions.
[0043] For candidate applicable data with the same rule version and business usage level, the system compares the frequency range inclusion relationship. If one frequency range is completely within another frequency range, and the rule text sets more specific application conditions for the smaller frequency range, the more specific candidate applicable data will be ranked first. The system writes the conditions used in each comparison and the comparison results into the rule application order data for easy querying of the applicable basis in subsequent queries.
[0044] The system generates rule application data and executable rule results according to the order in which the rules apply. Rule application data records the specification entity, rule conditions, application order, and source location; executable rule results record the applicable frequency range, permitted states, restricted states, required conditions, and the corresponding rule application identifier. If existing conditions are insufficient to form a unique result, the result state can be recorded as a condition to be supplemented, along with the condition fields that need to be read from the simulation state.
[0045] The system writes the applicable rule data and executable rule results into structured rule tuples. These structured rule tuples are stored in a fixed field order so that the simulation program can read them in batches according to field names. The system generates tuple combination identifiers based on the specification entity values and rule condition specification values, retains one tuple with the same combination identifier, and records the complete source location in the retained item.
[0046] Based on the structured rule tuples, the system further generates a rule knowledge graph. Graph nodes in the rule knowledge graph correspond to rule entities or rule conditions, and graph lines represent applicability, inclusion, restriction, or source relationships. Structured rule tuples are suitable for batch data processing, while the rule knowledge graph is suitable for performing relational queries based on clauses, business, frequency bands, regions, or conditions. Both data representations use the same standardized entity values.
[0047] In one executable implementation, the system can use NetworkX to generate a static rule knowledge graph, or it can use Neo4j to store queryable graph data. When using Neo4j, the system writes entity categories into node labels, canonical entity values, original text, and source location into node attributes, and rule relationships into graph connection types. When using PyVis, interactive HTML pages can be generated based on identical graph nodes and connections.
[0048] To improve the display efficiency of large-scale rule knowledge graphs, the system can load only node identifiers, node categories, and brief names on the initial page, and read detailed rule content when the user views a node. The system can also filter currently displayed nodes by entity category or locate target clauses based on keywords.
[0049] Step S200: Construct a frequency track resource scheduling simulation environment based on the rule-related data, and train a Python scheduling strategy model in the frequency track resource scheduling simulation environment.
[0050] In this embodiment, step S200 includes: reading rule application data and executable rule results that match the target scheduling conditions from the rule association data, and writing the valid application conditions into the scheduling restriction data; generating a candidate scheduling action set based on the current simulation state; extracting the scheduling condition data of each candidate scheduling action, comparing the scheduling condition data with the scheduling restriction data item by item, marking the allowed state and rule application identifier of each candidate scheduling action, and obtaining a feasible scheduling action matrix; constructing a frequency track resource scheduling simulation environment based on the feasible scheduling action matrix, selecting scheduling actions only from the candidate scheduling actions corresponding to the allowed state, and recording the selected scheduling actions and the corresponding rule application identifiers to obtain training association data; running a preset training program in the frequency track resource scheduling simulation environment, saving the model source code and model weights when the training state meets the preset conditions, and obtaining a Python scheduling strategy model.
[0051] like Figure 2 As shown, the system receives target scheduling conditions, which can be provided by a simulation task configuration file or a task interface. The target scheduling conditions must at least be comparable to the region, service, and frequency range in the rule application data; when the rule application data also includes version conditions or exception conditions, the target scheduling conditions may also include corresponding version parameters and status parameters.
[0052] The system reads the applicable data for the rules and performs matching on each applicable condition. Regional conditions and business conditions can be compared using the standard name or category number; frequency conditions can be compared using the standard frequency value for interval comparison; rule version conditions can be compared using the effective time or version order; and exception conditions can be judged using the condition object, comparison relationship, and current status parameters.
[0053] For successfully matched rule application data, the system reads the corresponding executable rule result and writes the valid application conditions into the scheduling restriction data. The scheduling restriction data can be stored in a list or table structure, with each data item recording the applicable frequency range, allowed status, service usage level, additional conditions, and rule application identifier. The rule application identifier is consistent with the rule application data in step S100.
[0054] The current simulation state refers to the state data obtainable from the simulation environment during a scheduling decision. The current simulation state may include region information, information on services to be scheduled, available frequency resources, task status, and rule condition parameters. The actual state fields used are adapted to the input interface of the scheduling strategy model; this embodiment does not limit specific training algorithms or state encoding methods.
[0055] The system generates a set of candidate scheduling actions based on the current simulation state. Each candidate scheduling action represents allocating the target service to a candidate frequency range or executing a preset resource configuration operation. Candidate scheduling actions have an action identifier and record scheduling condition data related to rule comparison. For models using a discrete action space, the action identifier can be an action number; for models outputting continuous evaluation data, the system can pre-discrete the available frequency range into candidate actions.
[0056] The system extracts the scheduling condition data for each candidate scheduling action and compares it item by item with the scheduling restriction data. During the comparison, it first determines whether the region and service of the candidate scheduling action are within the applicable scope of the rules, then determines whether the candidate frequency is within the allowed frequency range, and further checks the service usage level and additional conditions. When all necessary conditions are met, the corresponding candidate scheduling action is marked as allowed; if any necessary condition is not met, it is marked as restricted.
[0057] For scheduling constraint data whose result status is "conditions to be supplemented," the system reads the required condition parameters from the current simulation status. When the corresponding parameters are available, the comparison is completed according to the rules; when the corresponding parameters are not configured, the relevant candidate scheduling actions are set to the preset constraint status, and the missing condition field is recorded, so that the simulation task can regenerate the allowed status after the parameters are supplemented.
[0058] The system generates a feasible scheduling action matrix based on the current simulation state and the arrangement of candidate scheduling actions. Each row in the matrix corresponds to a simulation state sample, and each column corresponds to a candidate scheduling action. Matrix elements record allowed states and rule applicability identifiers. If a candidate scheduling action is subject to multiple rules, the set of rule applicability identifiers and the comparison results corresponding to each identifier can be stored in the matrix elements.
[0059] The feasible scheduling action matrix can be regenerated after each simulation state change, or it can be pre-generated and queried by state category when the rule conditions and candidate resources are fixed. The system sets matrix versions and rule data versions for the matrix, so that the training program can identify the rule data corresponding to the matrix when reading the matrix, avoiding the use of the old matrix after the rule data has been updated.
[0060] The system constructs a frequency track resource scheduling simulation environment based on the feasible scheduling action matrix. When the scheduling strategy model directly outputs the evaluation data of all candidate scheduling actions, the simulation environment reads the current matrix row after the model output, excludes candidate scheduling actions corresponding to the restricted state, and then selects scheduling actions from the actions corresponding to the allowed state according to a preset selection method.
[0061] When the input interface of the scheduling strategy model can receive candidate action information, the simulation environment can also read the feasible scheduling action matrix before model execution and write only the candidate scheduling actions corresponding to the allowed states into the model input. Both implementation methods ensure that candidate scheduling actions corresponding to the restricted states do not enter the final selection range; the specific method can be set according to the model interface.
[0062] The simulation environment records the simulation state identifier, candidate scheduling action identifier, allowed status of candidate scheduling actions, selected scheduling action, and corresponding rule application identifier used in each model run, forming training correlation data. The training correlation data can also record the model run batch, rule data version, and feasible scheduling action matrix version to support the subsequent reproduction of the scheduling process under the same conditions.
[0063] The system invokes a preset training program to run the scheduling strategy model within the frequency track resource scheduling simulation environment. For example, the preset training program can be a training program capable of generating PyTorch models. This embodiment does not impose fixed restrictions on the model training algorithm, evaluation method, or model parameter update rules.
[0064] The training status meets preset conditions, which can indicate that the training program has completed a preset number of training iterations, the model evaluation result has reached a preset threshold, or the system has received a training termination instruction. When the preset conditions are met, the system saves the model source code and model weights. The model source code includes at least the model class definition, constructor, and forward function, and the model weights include the parameter data for each neural network layer.
[0065] The Python scheduling strategy model can be a model that inherits from torch.nn.Module. The model can include neural network layers such as Linear, Conv2d, LSTM or GRU, as well as tensor operations such as dimension reshaping, multidimensional transpose, multidimensional indexing and tensor concatenation.
[0066] Step S300: Perform runtime information parsing and code structure parsing on the Python scheduling strategy model, merge the corresponding parsing results into an intermediate representation, and generate a C++ scheduling strategy model based on the intermediate representation.
[0067] In this embodiment, step S300 first includes: extracting rule change conditions from the scheduling constraint data that cause the allowed state of candidate scheduling actions to change; converting the rule change conditions into model input data according to the feasible scheduling action matrix and the training association data to obtain rule boundary data; inputting the rule boundary data into the Python scheduling strategy model, recording the actual execution path and running attribute data to obtain running parsing data; traversing the abstract syntax tree of the model source code, extracting the model construction structure and forward execution structure to obtain static structure data, and aligning the running parsing data with the static structure data according to the source code location, variable name, and branch condition to obtain a parsing correspondence; writing the running parsing data into the static structure data according to the parsing correspondence to obtain the intermediate representation, and generating a C++ scheduling strategy model based on the intermediate representation.
[0068] like Figure 3 As shown, a rule change condition refers to a condition that causes a change in the permissible state of at least one candidate scheduling action. The system can identify rule change conditions by comparing scheduling constraint data and feasible scheduling action matrices under adjacent scheduling conditions. When a condition changes, and the corresponding matrix element changes from a permissible state to a restricted state, or vice versa, the system records that condition as a rule change condition.
[0069] Rule change conditions can originate from changes in frequency intervals, regional application scope, business usage level comparison results, exception condition judgment results, or rule version effectiveness status. All of the above are uniformly recorded as rule change condition types, and the system saves the values before the change, the values at the change location, and the values after the change, thus ensuring that subsequent model inputs cover both sides of the condition and its location.
[0070] For example, for a regular frequency range with a starting frequency of 1450MHz, the system can generate adjacent frequency values less than 1450MHz, frequency values equal to 1450MHz, and adjacent frequency values greater than 1450MHz, according to the model input precision. The interval between adjacent frequency values and boundary frequency values can be set as a preset interval, which is determined based on the minimum effective precision of the frequency field in the model input.
[0071] The system combines the feasible scheduling action matrix to identify candidate scheduling actions affected by various rule changes. The system then queries the training correlation data, reads the simulation state fields and input positions corresponding to the candidate scheduling actions during model training, writes the values of the rule changes into the same input positions, and keeps the other state fields as valid values of the corresponding training samples, thereby forming the model input data.
[0072] When converting rule-changing conditions into model input data, the system uses the same category coding, numerical arrangement, and dimensional order as during the model training phase. When regions, business types, or rule versions are represented by category numbers, the rule boundary data uses the same numbering table; when continuous frequency values are represented by standardized frequency units, the rule boundary data also uses the same units to avoid coding differences between the parsed data and the model training input.
[0073] The system combines the generated model input data into rule boundary data and sets a data identifier, rule change condition type, change location, candidate scheduling action identifier, and rule application identifier for each rule boundary data item. These identifiers remain unchanged during model execution and are used to map the actual execution path and running attribute data to the rule change conditions that produced the running result.
[0074] The system inputs rule boundary data into the Python scheduling strategy model and records the actual execution path. The actual execution path can be obtained by setting the execution recording function at the conditional branches of the model's forward function, neural network layer calls, and tensor operation locations. The execution recording function writes the data identifier of the current rule boundary data, the source code location, the execution order, and the branch judgment result.
[0075] It should be noted that the execution log function is used to read the location of the code that has been executed by the model and its execution attributes. Execution log data can be stored in a separate log structure and associated with the data identifier of the rule boundary data after the current model execution is completed.
[0076] Runtime attribute data includes layer attributes, tensor sizes, and variable types that can be read during runtime from the model instance. The system can instantiate the model using Python reflection and call the `model.named_children` interface to traverse the neural network layers, reading runtime parameters such as the number of input features, the number of output features, the kernel size, the number of layers, bidirectional attributes, the projection size, and the batch dimension position.
[0077] For the calculated layer parameters, the system reads the actual attribute values already formed in the model instance. For example, when the model selects the hidden state size based on whether the projection size is greater than 0, the runtime information parsing directly records the final size in the instance. These actual attribute values are used to subsequently generate C++ neural network layers with defined initialization parameters.
[0078] The system also records the number of dimensions and the length of each dimension of the input and output tensors of each neural network layer, as well as the runtime type of variables within conditional branches. For cases where the model layer returns multiple results, the system records the type, size, and location of each returned object. This data, together with the actual execution path, constitutes the runtime parsing data.
[0079] The system traverses the abstract syntax tree of the model's source code, extracting the model's construction structure and forward execution structure. The model construction structure includes the model class, constructor, member variables, and neural network layer initialization statements; the forward execution structure includes assignment statements, conditional branches, loop statements, function calls, tensor slices, return statements, and the execution relationships between these statements.
[0080] The abstract syntax tree accessor records the node type, start position, end position, associated variable names, and parent control structure for each source code node. For conditional branches, the system also records the conditional expression and its two execution ranges; for loop structures, the system records the loop variable, loop range, and loop body; for function calls, the system records the called object and its input parameters.
[0081] The system aligns runtime parsing data with static structure data based on source code location, variable names, and branch conditions. Source code location pinpoints execution records to identical code statements; variable names specify tensor dimensions or variable types for the corresponding variable nodes; and branch conditions differentiate the execution attributes of the same variable across different execution paths.
[0082] When the same source code node has different tensor sizes or variable types under multiple rule boundary data, the system records the corresponding rule change conditions and branch execution conditions respectively. If different running attributes can generate C++ code separately according to the branch conditions, then each branch attribute is retained in the intermediate representation; if a unified type is required, then a target type that can accommodate the results of each branch is generated according to the preset type compatibility rules.
[0083] The system resolves the correspondence records between runtime parsing data identifiers, source code node identifiers, variable identifiers, branch conditions, and rule change conditions. Based on these correspondences, the system writes the runtime parsing data into static structured data, forming an intermediate representation. Each operation in the intermediate representation can be traced back to the source code node and the actual runtime data.
[0084] Intermediate representations can be stored using tree, graph, or list structures. Each intermediate representation operation must record at least the operation type, input variables, output variables, target layer parameters, control relationships, and source code node identifier. For nodes that have been actually executed by the rule boundary data, the runtime tensor size, variable types, and rule change conditions are also recorded; for nodes that have not yet been executed, the uncovered state is recorded.
[0085] When uncovered conditional branches exist in the intermediate representation, the system reads the corresponding branch conditions and queries the rule change conditions and existing training correlation data to generate supplementary rule boundary data. After the supplementary data is input into the Python scheduling strategy model again, the system updates the running information of the corresponding node. When the preset branch coverage condition is met, the system executes subsequent C++ code generation.
[0086] Furthermore, the steps of writing the runtime parsing data into the static structure data according to the parsing correspondence to obtain the intermediate representation, and generating a C++ scheduling strategy model based on the intermediate representation include: establishing a code mapping table according to the parsing correspondence, wherein the code mapping table records the correspondence between Python source code nodes, intermediate representation operations, target interfaces, and C++ code segments; reading variable definition information and operation results in the intermediate representation, and matching C++ variable types according to preset type rules; converting model operations in the intermediate representation into C++ interfaces according to preset semantic mapping relationships; pre-scanning variable definition and usage positions in the forward execution structure, and generating function-scoped variable declarations for variables used across branches; generating C++ model code according to the C++ variable types, the C++ interfaces, and the function-scoped variable declarations, and writing code segment identifiers into the code mapping table to form a C++ scheduling strategy model.
[0087] The code mapping table establishes the correspondence between Python source code, intermediate representation, and C++ model code. When building the code mapping table, the system first writes the Python source code node identifier, intermediate representation operation identifier, and expected target interface; after the C++ code is generated, it then writes the code segment identifier, code position, and weight data position.
[0088] In one executable implementation, Python source code node identifiers can be generated based on node type and source code location. Operation identifiers can be generated according to the model execution order. C++ code section identifiers can be generated separately for class initialization sections, forward operation sections, conditional branch sections, and output sections. Each identifier remains unique within a single model transformation task.
[0089] The system reads variable definition information and operation results from the intermediate representation and matches them with C++ variable types according to preset type rules. The output of neural network layers or tensor operations can match the shared tensor type, the tensor size reading result can match the integer type, the condition judgment result can match the boolean type, and the model layer object can match the shared pointer type of the corresponding neural network layer.
[0090] For variables whose types cannot be matched solely by their names, the system further reads the assignment operation and the return result of the calculation. If the variable receives the return value of a known C++ interface, the default return type of that interface is used; if the variable receives compatible types in multiple branches, a unified type is generated according to the default compatibility relationship; if the branch types are incompatible, processing code within each branch is generated separately.
[0091] The system converts model operations in the intermediate representation into C++ interfaces according to a preset semantic mapping relationship. The preset semantic mapping relationship records the correspondence between Python neural network layers or tensor operations and lightweight C++ runtime interfaces, including the order of input parameters, return data structures, and dimensionality processing rules.
[0092] For example, the Linear, Conv2d, LSTM, and GRU layers in Python can be mapped to their corresponding layer interfaces in the C++ runtime. Dimension reshaping, multidimensional transpose, multidimensional indexing, and tensor concatenation operations can be mapped to their corresponding functions provided by the tensor class. For model layers that return multiple objects, the system generates code for reading structure members or standard tuples according to the C++ interface definition.
[0093] The C++ runtime can be implemented using the C++11 standard. Tensor classes use contiguous floating-point arrays to store data and manage tensor objects through shared pointers. The neural network layer interfaces in the runtime read weight data in a pre-formatted manner and perform forward operations according to the same parameter meanings as in the Python model. The input and output dimension rules for each interface are recorded in a pre-defined semantic mapping relationship.
[0094] The system pre-scans the variable definition and usage locations within the forward execution structure. When a variable is defined in a conditional branch and used after the conditional branch ends, the system pre-generates the variable declaration within the function scope and then assigns values to the variable in each conditional branch. Thus, the generated C++ code satisfies the variable declaration scope requirements.
[0095] For tensors and neural network layer objects, the system uses shared pointers to manage their lifecycles. For integers, booleans, and other basic types, the system generates declarations based on the inferred C++ variable types. Function-scoped variable declarations and their corresponding Python variable nodes are written together into the code mapping table, enabling compilation errors to be located at the corresponding source code nodes.
[0096] Furthermore, the steps of generating C++ model code according to the C++ variable types, C++ interfaces, and function scope variable declarations, and writing code segment identifiers into the code mapping table to form a C++ scheduling strategy model include: generating code generation constraint data based on the intermediate representation and the code mapping table, wherein the code generation constraint data includes allowed call interfaces, operator execution order, variable types, and branch relationships; generating a C++ template with inference logic filling positions; generating prompt information based on the code generation constraint data; and calling the large language model to generate core inference code at the inference logic filling positions. The core inference code is compared item by item with the code generation constraint data. When the comparison passes, the core inference code is written into the C++ template to obtain the C++ model code. The weight export logic is run in an independent process to generate a weight file containing dimension information and data type information, and the weight data position is written into the code mapping table. The C++ model code combined with the weight file is compiled. When the compilation fails or the output verification fails, the code mapping table is queried according to the compilation information or misaligned data to locate and regenerate the problematic code segment until the compilation passes and the preset verification conditions are met, thus forming a C++ scheduling strategy model.
[0097] The code generation constraint data is generated based on the model structure in the intermediate representation and the lightweight C++ runtime capabilities. It allows calling interfaces to record the tensor interfaces and neural network layer interfaces available for the current model transformation task; operator execution order records the sequential relationship of operations in the forward function; variable type records the target types of each input variable, temporary variable, and output variable; and branching relationships record conditional expressions and their corresponding execution sections.
[0098] The system generates a C++ template. This template includes header file references, input file reading, exception handling, model instantiation, weight loading, output saving, and program return logic. It also sets inference logic population locations where forward call code needs to be generated in conjunction with the specific model. The fixed code within the template is generated by a pre-defined program to maintain a consistent basic structure across different model conversion tasks.
[0099] The system generates prompts based on the code-generated constraint data, Python model source code, intermediate representation, and C++ runtime interface specifications. These prompts require the large language model to generate core inference code only at the inference logic population locations, and to use allowed call interfaces, preset variable types, and preset branching relationships. The code returned by the large language model is saved as the code section to be inspected.
[0100] The system reads the interface calls in the core inference code and compares them item by item with the allowed interfaces; it reads the order in which the interfaces appear and compares it with the execution order of the operators; it reads variable declarations and function parameters and compares them with the variable types; it reads conditional expressions and code ranges and compares them with the branching relationships. After all comparisons pass, the system writes the core inference code into a C++ template.
[0101] When the core inference code contains unauthorized interfaces, missing expected operators, inconsistent variable types, or inconsistent branching relationships, the system generates code inspection information. This information records the problem type, the corresponding intermediate representation operation, and the locations that need to be regenerated. Based on this information, the system updates the warning message and regenerates the corresponding code.
[0102] The system incorporates weight export logic into the model source code and runs the export script via a temporary directory and a separate process. The weight export logic reads the model parameter names, shapes, data types, and parameter data, and writes them to the weight file according to a preset binary serialization format. After the separate process finishes execution, the system verifies whether the weight file has been completely generated.
[0103] Each parameter in the weight file has a parameter identifier, dimension information, data type information, and data location. The system writes the weight data location into the corresponding model layer record in the code mapping table. When the C++ model loads the weights, it queries the parameters according to the model layer identifier, validates the parameter dimensions and data types, and writes the parameters into the corresponding neural network layer after successful validation.
[0104] The system compiles the C++ model code that incorporates the weight file. If compilation fails, the system reads the file location, line of code, variable name, and interface name from the compilation information, and queries the code mapping table based on the code segment identifier to obtain the corresponding Python source code node, intermediate representation operation, and target interface.
[0105] The system only regenerates the code for the identified problematic code segments. During regeneration, compilation information, corresponding intermediate representation operations, allowed call interfaces, variable types, and branch relationships are written into the error message; the remaining code segments that have passed code inspection and compilation remain unchanged. After regeneration, code inspection and compilation are performed again.
[0106] When a C++ program can compile but fails the preset output verification, the system reads the output location or intermediate layer location corresponding to the misaligned data and queries the relevant code segment through the code mapping table. The system performs the same targeted regeneration process on the problematic code segment until the C++ model code can compile and meets the preset verification conditions.
[0107] Step S400: Run the Python scheduling strategy model and the C++ scheduling strategy model using the same standardized simulation data, and generate simulation verification results based on the differences in model output and preset thresholds.
[0108] In this embodiment, step S400 includes: extracting boundary conditions from the scheduling constraint data that cause changes in the permissible states in the feasible scheduling action matrix, and generating boundary condition data by combining the training correlation data; converting the boundary condition data into raw simulation data that conforms to the input interface of the Python scheduling strategy model, unifying the numerical precision of the raw simulation data and correcting abnormal values to obtain standardized simulation data; synchronously saving the standardized simulation data as a binary input file and a structured input file, and generating metadata recording the data shape, data type, and boundary condition category; loading the binary input file into the C++ scheduling strategy model, loading the structured input file into the Python scheduling strategy model, and validating both inputs element by element according to a preset tolerance; running the Python scheduling strategy model and the C++ scheduling strategy model after the input validation passes, obtaining model output data, and generating the simulation verification result based on the model output data and the preset threshold.
[0109] like Figure 4 As shown, the system reads scheduling constraint data and feasible scheduling action matrix to find the locations where state changes are allowed. The system establishes boundary condition categories according to the types of rule change conditions and reads the simulation states corresponding to relevant candidate scheduling actions from the training correlation data, thereby forming boundary condition data that includes both boundary conditions and complete model input fields.
[0110] For the ends of a frequency range, boundary condition data can include adjacent values at the start of the range, the start position, values within the range, the end position, and adjacent values at the end position; for changes in category conditions, data corresponding to the category before the change, the target category, and the category after the change can be used respectively; for exceptional conditions, data for conditions met and conditions not met can be generated respectively.
[0111] The system converts boundary condition data into raw simulation data that conforms to the Python scheduling strategy model input interface. The conversion program reads the mapping relationship between the model input fields and the simulation state fields, writes the region, business, frequency, rule conditions, and other state parameters into the corresponding input positions, and assembles them into batch dimension, sequence dimension, and feature dimension according to the model requirements.
[0112] The original simulation data can come from .npy, .bin, or CSV files, or can be directly generated by the data preparation program. The system converts the original simulation data to float32 precision and checks whether each element is NaN or an infinite value. When an abnormal value is found, it is replaced with a value that can participate in the model calculation according to the preset anomaly handling rules.
[0113] The system processes the raw simulation data using the same data processing method as during the model training phase, and then synchronously saves the standardized simulation data into binary input files and structured input files. The binary input file is arranged according to continuous floating-point data for the C++ scheduling strategy model to read; the structured input file stores the data shape and floating-point data for the Python scheduling strategy model to read. Both types of files are written from the same memory data object.
[0114] Metadata records data shape, data type, sample identifier, boundary condition category, rule applicability identifier, and file location. The system reads the metadata before loading the input file to ensure that both models use the same batch order, dimensional order, and number of elements. The metadata is also used to reconstruct the boundary conditions corresponding to each output when comparing model outputs.
[0115] The system loads the binary input file into the C++ scheduling strategy model and the structured input file into the Python scheduling strategy model, and validates both inputs element by element according to a preset tolerance. In one executable implementation, the preset tolerance is set to 1e-4. The system compares the absolute differences of elements in the same index order and records the sample identifiers and element indices that exceed the preset tolerance.
[0116] When any input element fails to meet the preset tolerance, the system generates an input validation failure message and checks the binary data reading order, dimension arrangement, numerical precision, and abnormal value handling results. Only after the input validation passes will the system run both models, ensuring that subsequent output differences correspond to the model transformation process and are unaffected by differences in input files.
[0117] After input validation, the Python scheduling strategy model loads the model source code and model weights saved in step S200, while the C++ scheduling strategy model loads the executable program and weight file generated in step S300. Both models perform forward computation according to the sample order recorded in the metadata, yielding the Python model output and the C++ model output.
[0118] The steps for generating the simulation verification result based on the model output data and the preset threshold include: aligning the outputs of the Python scheduling strategy model and the C++ scheduling strategy model according to the sample identifier and boundary condition category in the metadata to obtain aligned output data; calculating error indices based on the aligned output data, wherein the error indices include maximum absolute error, mean square error, and cosine similarity; comparing each error indices with the corresponding preset threshold to generate a verification pass result or a verification fail result; when generating a verification fail result, generating diagnostic information based on the misaligned data, the corresponding boundary conditions, and model running information, correcting the C++ model code according to the diagnostic information, and re-executing input validation and output comparison until a verification pass result is generated.
[0119] The system aligns the outputs of two models according to sample identifiers and output indices. If the shapes of the output data from the two models are different, the system first generates a shape validation failure message; if the shapes are the same, the output elements at the same index position are grouped together to align the output data. The system also establishes output sets according to boundary condition categories to statistically analyze the validation status of various rule change positions.
[0120] The maximum absolute error is obtained by iterating through the absolute differences of the corresponding output elements and finding the maximum value; the mean square error is obtained by calculating the square of the differences of the corresponding elements and averaging all the squared values; the cosine similarity is obtained by comparing the degree of consistency in the directions of the two flattened output vectors.
[0121] The system compares the maximum absolute error and mean squared error with their respective preset upper limit thresholds, and the cosine similarity with its corresponding preset lower limit threshold. If all error metrics for a boundary condition category meet their corresponding thresholds, the category generates a validation pass result; if any metric fails to meet its corresponding threshold, the category generates a validation fail result.
[0122] When all boundary condition categories generate valid results, the system generates an overall valid result and records the input file, model file, weight file, metadata, and various error metrics. The simulation validation results can be saved as a structured report and associated with the current C++ scheduling strategy model's code version and weight version.
[0123] When a validation failure result is generated, the system extracts the output index, Python output value, C++ output value, corresponding sample identifier, and boundary conditions that exceed a preset threshold, forming misaligned data. The system also records the model input shape, weight loading results, actual execution branches, and program return information, forming model runtime information.
[0124] The system generates diagnostic information based on misaligned data, boundary conditions, and model runtime information. If input validation fails, the system checks the input file reading process; if input validation passes and output differences are concentrated in specific conditional branches, the system queries the corresponding C++ code section; if model layer parameters are not fully loaded, the system checks the parameter names, dimensions, and data locations in the weight file.
[0125] The system corrects the C++ model code based on the diagnostic information and re-executes code checks, compilation, input validation, and output comparison. During the re-verification process, the Python scheduling strategy model, Python model weights, and standardized simulation data remain unchanged, ensuring that all comparisons use the same benchmark. Once all error metrics meet their corresponding thresholds, the system updates the simulation verification results.
[0126] The following example illustrates the execution process of steps S100 to S400. The frequency values and rule names in this example are for illustrative purposes only and do not constitute a fixed limitation on the actual content of ITU rules and regulations. The model structure and conversion parameters use the SimpleLSTM model and its corresponding data.
[0127] The system extracts rule-applicable data A and rule-applicable data B from the test rule document. Rule-applicable data A corresponds to Area 1, Service A, the frequency range of 1450MHz to 1452MHz, and the first service usage level; rule-applicable data B corresponds to Area 1, Service B, the frequency range of 1451MHz to 1453MHz, and the second service usage level, and records an exception condition controlled by a preset status parameter.
[0128] like Figure 5 As shown, the applicable data for rule A and rule for rule B overlap between 1451MHz and 1452MHz. The system reads the exception condition matching results and continues to compare the service usage level, rule version effective order, and frequency range inclusion relationship to obtain the rule application order. The system generates executable rule results for the overlapping range according to the said order.
[0129] The system generates four candidate scheduling actions based on the current simulation state, corresponding to 1449.9MHz, 1450MHz, 1451.5MHz, and 1453.1MHz, respectively. The system compares each candidate scheduling action with the scheduling constraint data item by item, marks the allowed state, and writes the rule applicable identifier that forms the state into the feasible scheduling action matrix.
[0130] like Figure 6As shown, in an example state, the candidate scheduling action corresponding to 1450MHz is marked as an allowed state, the candidate scheduling action corresponding to 1451.5MHz is marked as a conditionally allowed state based on the exception condition, and the candidate scheduling actions corresponding to 1449.9MHz and 1453.1MHz are marked as restricted states. The training program selects scheduling actions only from the allowed state or the conditionally allowed state after the condition is met.
[0131] The Python scheduling strategy model uses a SimpleLSTM structure with 20 input features, 12 hidden layers, 2 recurrent layers, a bidirectional structure, and 1 output dimension. In the example, the input batch size is 8, the sequence length is 15, and the number of input features is 20. Therefore, the model input shape is [8, 15, 20], and the model output shape is [8, 1].
[0132] The model's forward function reads the batch number based on the batch dimension, generates an initial state tensor, calls an LSTM layer to obtain the output state, combines the bidirectional states, inputs them into a Linear layer, and obtains the final output tensor. The system saves the model source code and model weights, and records the selected scheduling action and corresponding rule application identifier for each training sample in the training association data.
[0133] The system generates rule boundary data around frequency positions of 1450MHz, 1451MHz, 1452MHz, and 1453MHz, and generates input data for exception conditions that are met and not met, respectively. The rule boundary data is converted into an input tensor of [8, 15, 20] according to the field arrangement during the model training phase, and then input into the Python scheduling policy model.
[0134] The system records the actual execution path, layer attributes, tensor size, and variable type corresponding to each rule boundary data. It then traverses the abstract syntax tree of the model source code to generate an intermediate representation. The runtime information is parsed and reads attributes such as input_size, hidden_size, num_layers, bidirectional, batch_first, and proj_size from the SimpleLSTM instance.
[0135] like Figure 7 As shown, the system maps the model layer initialization nodes, conditional branch nodes, and forward operation nodes in the Python source code to intermediate representation operations, and then to the C++ class initialization section, C++ conditional code section, and C++ forward operation section, respectively. The code mapping table records the identifier of each code section, as well as the corresponding source code node and target interface.
[0136] The system generates the C++ class structure and forward inference function of SimpleLSTM based on the intermediate representation. The C++ code uses shared pointers to store the LSTM layer and the Linear layer, generates layer initialization parameters based on runtime attributes, and converts the state reading, tensor combination, and Linear calls in Python into corresponding interfaces in the lightweight C++ runtime.
[0137] The weight export program reads the Python model parameters in a separate process and generates a weight file according to a preset binary format. The C++ program loads the weights according to the parameter name, dimension information, and data type information. After the system completes code checking and compilation, it generates an executable program that can read the binary input file.
[0138] The data preparation program generates input data of shape [8, 15, 20], performs float32 precision conversion, outlier checks, and preset standardization, and simultaneously saves it as a .npy structured input file and a .bin binary input file. Metadata records the input shape, data type, sample identifier, and boundary condition category.
[0139] The system compares the Python and C++ inputs element-wise with a preset tolerance of 1e-4. For example, the maximum input difference is 0.000001, which meets the preset input validation condition. After successful input validation, both models perform forward operations and output the corresponding tensors.
[0140] For example, in the output comparison results, the maximum absolute error is displayed as 0.000000, the mean square error is displayed as 0.000000, and the cosine similarity is displayed as 1.000000. It should be noted that the above displayed values are exemplary results generated by the example program according to the current display precision, used to characterize the situation where the model outputs of the two execution environments meet the preset consistency requirements.
[0141] If the output error of a certain exception condition category exceeds a preset threshold, the system queries the corresponding rule change condition based on the sample identifier and locates the corresponding C++ condition code segment according to the code mapping table. The system regenerates the problematic code segment, keeping the already verified model layer initialization segment and other forward operation segments unchanged, and then performs compilation and verification.
[0142] This application also provides a scheduling strategy training and simulation verification system based on ITU rules. Please refer to [reference needed]. Figure 8 The scheduling strategy training and simulation verification system based on ITU rules includes: Rule processing module 10 is used to parse ITU rule documents and obtain rule-related data; The strategy training module 20 is used to construct a frequency track resource scheduling simulation environment based on the rule-related data, and to train a Python scheduling strategy model in the frequency track resource scheduling simulation environment. The model conversion module 30 is used to parse the runtime information and code structure of the Python scheduling strategy model, merge the corresponding parsing results into an intermediate representation, and generate a C++ scheduling strategy model based on the intermediate representation. The simulation verification module 40 is used to run the Python scheduling strategy model and the C++ scheduling strategy model using the same standardized simulation data, and generate simulation verification results based on the differences in model output and preset thresholds.
[0143] The scheduling strategy training and simulation verification system based on ITU rules provided in this application adopts the scheduling strategy training and simulation verification method based on ITU rules in the above embodiments. Compared with the prior art, the beneficial effects of the scheduling strategy training and simulation verification system based on ITU rules provided in this application are the same as those of the scheduling strategy training and simulation verification method based on ITU rules provided in the above embodiments, and other technical features of the scheduling strategy training and simulation verification system based on ITU rules are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0144] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0145] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct or indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A method for training and simulating scheduling strategies based on ITU rules, characterized in that, The method includes the following steps: Parse the ITU rules document to obtain the rule-related data; A frequency track resource scheduling simulation environment is constructed based on the rule-related data, and a Python scheduling strategy model is trained in the frequency track resource scheduling simulation environment. Specifically, this includes: reading the applicable rule data and executable rule results that match the target scheduling conditions from the rule association data, and writing the valid applicable conditions into the scheduling restriction data; generating a set of candidate scheduling actions based on the current simulation state; extracting the scheduling condition data of each candidate scheduling action, comparing the scheduling condition data with the scheduling restriction data item by item, marking the allowed state and rule applicable identifier of each candidate scheduling action, and obtaining a feasible scheduling action matrix; constructing a frequency track resource scheduling simulation environment based on the feasible scheduling action matrix, selecting scheduling actions only from the candidate scheduling actions corresponding to the allowed state, and recording the selected scheduling actions and the corresponding rule applicable identifiers to obtain training association data; running a preset training program in the frequency track resource scheduling simulation environment, saving the model source code and model weights when the training state meets the preset conditions, and obtaining a Python scheduling strategy model; The Python scheduling strategy model is subjected to runtime information parsing and code structure parsing. The corresponding parsing results are merged into an intermediate representation, and a C++ scheduling strategy model is generated based on the intermediate representation. Specifically, this includes: extracting rule change conditions from the scheduling constraint data that cause the allowed state of candidate scheduling actions to change; converting the rule change conditions into model input data based on the feasible scheduling action matrix and the training association data to obtain rule boundary data; inputting the rule boundary data into the Python scheduling strategy model, recording the actual execution path and running attribute data to obtain running parsing data; traversing the abstract syntax tree of the model source code, extracting the model construction structure and forward execution structure to obtain static structure data, and aligning the running parsing data with the static structure data according to the source code location, variable name, and branch condition to obtain a parsing correspondence; writing the running parsing data into the static structure data according to the parsing correspondence to obtain the intermediate representation, and generating a C++ scheduling strategy model based on the intermediate representation; The Python scheduling strategy model and the C++ scheduling strategy model are run using the same standardized simulation data, and simulation verification results are generated based on the differences in model output and preset thresholds.
2. The method for training and simulating scheduling strategies based on ITU rules as described in claim 1, characterized in that, The steps to parse ITU rule documents and obtain rule-related data include: Read the ITU rules document and convert it into plain text; According to the preset matching rules, rule entity data is extracted from the plain text. The frequency unit and text format of the rule entity data are unified and duplicates are deleted to obtain standardized entity data. The rule entity data includes clause entities, business entities, frequency band entities and region entities. The standardized entity data is combined according to the co-occurrence relationship of entities within the same text unit to obtain structured rule tuples; Based on the structured rule tuples, rule applicable data and rule knowledge graphs are generated, and the structured rule tuples, rule applicable data, and rule knowledge graphs are used as rule association data.
3. The method for training and simulating scheduling strategies based on ITU rules as described in claim 2, characterized in that, The steps for combining the standardized entity data according to the co-occurrence relationships of entities within the same text unit to obtain structured rule tuples include: The plain text is divided into text units according to paragraph boundaries or sentence ends, and the rule entity data and rule condition data in each text unit are located. By binding rule entity data and rule condition data within the same text unit, candidate applicable data is obtained; When the frequency ranges of multiple candidate applicable data overlap, the rule application order is obtained by comparing the exception condition matching results, business usage level, rule version effective order and frequency range inclusion relationship. The applicable data and executable rule results are generated according to the order in which the rules apply, and then written into a structured rule tuple.
4. The method for training and simulating scheduling strategies based on ITU rules as described in claim 1, characterized in that, The steps of writing the runtime parsing data into the static structure data according to the parsing correspondence to obtain the intermediate representation, and generating a C++ scheduling strategy model based on the intermediate representation include: A code mapping table is established based on the parsed correspondence, wherein the code mapping table records the correspondence between Python source code nodes, intermediate representation operations, target interfaces and C++ code segments; Read the variable definition information and calculation results from the intermediate representation, and match the C++ variable type according to the preset type rules; According to the preset semantic mapping relationship, the model operations in the intermediate representation are converted into a C++ interface; Pre-scan the variable definition and usage locations in the forward execution structure, and generate function-scoped variable declarations for variables used across branches; C++ model code is generated according to the C++ variable types, C++ interfaces, and function scope variable declarations, and the code segment identifiers are written into the code mapping table to form a C++ scheduling strategy model.
5. The method for training and simulating scheduling strategies based on ITU rules as described in claim 4, characterized in that, The steps for generating C++ model code according to the C++ variable types, C++ interfaces, and function scope variable declarations, and writing code segment identifiers into the code mapping table to form a C++ scheduling strategy model include: Code generation constraint data is generated based on the intermediate representation and the code mapping table, wherein the code generation constraint data includes allowed call interfaces, operator execution order, variable types, and branch relationships; Generate a C++ template with inference logic filling positions, generate constraint data and prompt information based on the code, and call the large language model to generate core inference code at the inference logic filling positions; The core inference code is compared item by item with the code generation constraint data. When the comparison passes, the core inference code is written into the C++ template to obtain the C++ model code. The weight export logic is run in an independent process to generate a weight file containing dimension information and data type information, and the weight data location is written into the code mapping table. The C++ model code is compiled in conjunction with the weight file. If the compilation fails or the output verification fails, the code mapping table is queried according to the compilation information or misaligned data to locate and regenerate the problematic code segment until the compilation is successful and the preset verification conditions are met, thus forming a C++ scheduling strategy model.
6. The method for training and simulating scheduling strategies based on ITU rules as described in claim 1, characterized in that, The steps for running the Python scheduling strategy model and the C++ scheduling strategy model using the same standardized simulation data, and generating simulation verification results based on the differences in model output and preset thresholds, include: Boundary conditions that cause changes in the allowed states in the feasible scheduling action matrix are extracted from the scheduling constraint data, and boundary condition data is generated by combining the training correlation data. The boundary condition data is converted into raw simulation data that conforms to the input interface of the Python scheduling strategy model. The numerical accuracy of the raw simulation data is unified and abnormal values are corrected to obtain standardized simulation data. The standardized simulation data is simultaneously saved as binary input files and structured input files, and metadata is generated to record the data shape, data type, and boundary condition category. The binary input file is loaded into the C++ scheduling strategy model, the structured input file is loaded into the Python scheduling strategy model, and the inputs at both ends are verified element by element according to the preset tolerance. After the input validation passes, the Python scheduling strategy model and the C++ scheduling strategy model are run to obtain the model output data, and the simulation verification result is generated based on the model output data and the preset threshold.
7. The method for training and simulating scheduling strategies based on ITU rules as described in claim 6, characterized in that, The steps for generating the simulation verification result based on the model output data and the preset threshold include: The outputs of the Python scheduling strategy model and the C++ scheduling strategy model are aligned according to the sample identifiers and boundary condition categories in the metadata to obtain aligned output data. The error index is calculated based on the aligned output data, wherein the error index includes the maximum absolute error, the mean square error, and the cosine similarity. Each of the aforementioned error indicators is compared with its corresponding preset threshold to generate a verification pass result or a verification fail result. When the verification fails, diagnostic information is generated based on the misaligned data, the corresponding boundary conditions, and the model running information. The C++ model code is then corrected according to the diagnostic information, and the input validation and output comparison are re-executed until a verification passes.
8. A scheduling strategy training and simulation verification system based on ITU rules, characterized in that, The system includes: The rule processing module is used to parse ITU rule documents and obtain rule-related data; The strategy training module is used to construct a frequency track resource scheduling simulation environment based on the rule association data, and train a Python scheduling strategy model in the frequency track resource scheduling simulation environment. Specifically, it includes: reading rule application data and executable rule results matching the target scheduling conditions from the rule association data, and writing the effective application conditions into the scheduling restriction data; generating a candidate scheduling action set based on the current simulation state; extracting the scheduling condition data for each candidate scheduling action, comparing the scheduling condition data with the scheduling restriction data item by item, marking the allowed state and rule application identifier of each candidate scheduling action, and obtaining a feasible scheduling action matrix; constructing a frequency track resource scheduling simulation environment based on the feasible scheduling action matrix, selecting scheduling actions only from the candidate scheduling actions corresponding to the allowed state, and recording the selected scheduling actions and their corresponding rule application identifiers to obtain training association data; running a preset training program in the frequency track resource scheduling simulation environment, and saving the model source code and model weights when the training state meets the preset conditions to obtain the Python scheduling strategy model. The model conversion module is used to parse the runtime information and code structure of the Python scheduling strategy model, merge the corresponding parsing results into an intermediate representation, and generate a C++ scheduling strategy model based on the intermediate representation. Specifically, it includes: extracting rule change conditions from the scheduling constraint data that cause the allowed state of candidate scheduling actions to change; converting the rule change conditions into model input data based on the feasible scheduling action matrix and the training association data to obtain rule boundary data; inputting the rule boundary data into the Python scheduling strategy model, recording the actual execution path and runtime attribute data to obtain runtime parsing data; traversing the abstract syntax tree of the model source code, extracting the model construction structure and forward execution structure to obtain static structure data, and aligning the runtime parsing data with the static structure data according to the source code location, variable name, and branch conditions to obtain a parsing correspondence; writing the runtime parsing data into the static structure data according to the parsing correspondence to obtain the intermediate representation, and generating a C++ scheduling strategy model based on the intermediate representation. The simulation verification module is used to run the Python scheduling strategy model and the C++ scheduling strategy model using the same standardized simulation data, and generate simulation verification results based on the differences in model output and preset thresholds.
