A data processing method and related apparatus

CN122985177APending Publication Date: 2026-10-27LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611153071.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-30
Publication Date
2026-10-27

Smart Images

  • Figure CN122985177A_ABST
    Figure CN122985177A_ABST
Patent Text Reader

Abstract

The application discloses a data processing method and related device, and relates to the technical field of artificial intelligence, and comprises the following steps: converting original rules expressed in natural language into intermediate rules expressed in intermediate syntax structures, wherein the original rules are used for describing configuration constraints of bill of materials and object correlation, and the intermediate syntax structures are used for expressing complex logic for configuring at least one to-be-configured object, and the complex logic is composed of multiple basic logics; and converting the intermediate rules into executable rules expressed in target syntax structures, so that a target system can identify the configuration constraints, and the target syntax structures are used for expressing binary selection logic for configuring at least one to-be-configured object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a data processing method and related apparatus. Background Technology

[0002] In manufacturing product configuration management scenarios, the composition of product components and the selection constraints between these components are described by Bill of Materials (BOM / OD) rules. Typically, a development-side rule management system is needed to translate these BOM / OD rules into machine language and synchronize them to the Enterprise Resource Planning (ERP) system for execution, thereby achieving automated product configuration.

[0003] For R&D-side rule management systems that can only recognize binary choice logic rules, R&D personnel need to manually rewrite natural language rules containing complex logic into such assembly syntax rules before entering them into the system. Summary of the Invention

[0004] In view of the above problems, this application provides a data processing method and related apparatus, the specific solution of which is as follows:

[0005] The first aspect of this application provides a data processing method, including:

[0006] The original rules expressed in natural language are converted into intermediate rules expressed in an intermediate syntax structure. The original rules are used to describe the configuration constraints of the bill of materials and object relevance. The intermediate syntax structure is used to express the complex logic of configuring at least one object to be configured. The complex logic consists of multiple basic logics.

[0007] The intermediate rules are converted into executable rules expressed in a target syntax structure so that the target system can recognize the configuration constraints. The target syntax structure is used to express binary selection logic for configuring at least one object to be configured.

[0008] In one possible implementation, the original rules expressed in natural language are transformed into intermediate rules expressed in an intermediate grammar structure, including:

[0009] The original rules, expressed in natural language, are input into the large language model to obtain the intermediate rules, expressed in the intermediate syntax structure, output by the large language model.

[0010] The large language model learns based on training corpus to establish a mapping relationship from natural language to the intermediate grammatical structure. The training corpus includes natural language rules and intermediate grammatical structure expressions corresponding to the natural language rules.

[0011] One possible implementation also includes:

[0012] Obtain the training corpus;

[0013] The prompt information is input into the large language model. The prompt information includes the training corpus and the target prompt word. The target prompt word is used to instruct the large language model to learn the mapping relationship from natural language to the intermediate grammatical structure.

[0014] In one possible implementation, the intermediate syntax structure includes a combination of syntax elements of various basic logics, wherein the syntax elements of the basic logics include key characters and parameters, and the key characters and parameters are combined according to the syntax rules of the basic logics to express the basic logics.

[0015] The key characters are used to identify the type of the basic logic, and the parameters are used to identify the object to be configured.

[0016] In one possible implementation, the basic logic includes the following types:

[0017] Binary selection is used to express whether the configuration object is selected or not.

[0018] Boolean logic is used to express logical operations between at least two objects to be configured, including logical AND and / or logical OR relationships.

[0019] Quantity constraints are used to express constraints on the number of objects to be configured.

[0020] Dependency constraints are used to express the selection dependencies between multiple objects to be configured;

[0021] Feature constraints are used to express the feature selection constraints of the object to be configured.

[0022] In one possible implementation, the original rules can be obtained in the following ways:

[0023] The original rules are obtained from a rule base that records historical rules described in natural language; or the original rules are generated based on the multimodal feature data of the target product.

[0024] In one possible implementation, the intermediate rules are converted into executable rules expressed in the target syntax structure, including:

[0025] Based on the mapping relationship between the intermediate syntax structure and the target syntax structure, the intermediate rule is mapped to the executable rule.

[0026] One possible implementation also includes:

[0027] Based on the syntax rules of the intermediate syntax structure, the intermediate rules are subjected to syntax validation.

[0028] A second aspect of this application provides a data processing apparatus, comprising:

[0029] The semantic recognition unit is used to convert the original rules expressed in natural language into intermediate rules expressed in an intermediate syntax structure. The original rules are used to describe the configuration constraints of the bill of materials and object relevance. The intermediate syntax structure is used to express the complex logic of configuring at least one object to be configured. The complex logic consists of multiple basic logics.

[0030] A syntax compilation unit is used to convert the intermediate rules into executable rules expressed in a target syntax structure, so that the target system can recognize the configuration constraints. The target syntax structure is used to express binary selection logic for configuring at least one object to be configured.

[0031] A third aspect of this application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:

[0032] The memory is used to store computer programs;

[0033] The processor is used to execute the computer program to enable the electronic device to perform:

[0034] The original rules expressed in natural language are converted into intermediate rules expressed in an intermediate syntax structure. The original rules are used to describe the configuration constraints of the bill of materials and object relevance. The intermediate syntax structure is used to express the complex logic of configuring at least one object to be configured. The complex logic consists of multiple basic logics.

[0035] The intermediate rules are converted into executable rules expressed in a target syntax structure so that the target system can recognize the configuration constraints. The target syntax structure is used to express binary selection logic for configuring at least one object to be configured. Attached Figure Description

[0036] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and elements are not necessarily drawn to scale.

[0037] Figure 1 A flowchart illustrating a data processing method provided in this application;

[0038] Figure 2a A schematic diagram of a system structure provided in an embodiment of this application;

[0039] Figure 2b This is another system structure diagram provided in the embodiments of this application;

[0040] Figure 3 A flowchart illustrating another data processing method provided in an embodiment of this application;

[0041] Figure 4 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;

[0042] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0043] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.

[0044] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0045] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar elements and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing elements with the same properties in the description of embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of units is not necessarily limited to those units, but may include other units not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0046] To improve efficiency, large language models can be used to directly convert natural language rules into binary choice logic rules that can be recognized by the R&D-side rule management system. However, there is a significant difference in expressive power between binary choice logic rules and the complex logic contained in natural language rules. Therefore, large language models must simultaneously undertake the dual tasks of semantic understanding and grammatical adaptation during the single-step direct conversion process. The semantic understanding error and the grammatical adaptation error are coupled and superimposed, resulting in low conversion accuracy, which cannot meet the requirements of production-level use.

[0047] Based on this, embodiments of this application provide a data processing method and related apparatus that can automatically convert natural language rules into binary selection logic rules recognizable by the R&D-side rule management system, avoiding the low conversion accuracy caused by the coupling and superposition of semantic understanding errors and grammatical adaptation errors. Thus, the accuracy of rule conversion is improved.

[0048] It should be noted that the data processing method and related apparatus provided in this application embodiment can be applied to the conversion scenario between complex logical expressions in natural language and binary selection logical expressions in the target system, and are not limited to rule conversion for the R&D side rule management system.

[0049] Reference Figure 1 , Figure 1 This is a flowchart illustrating a data processing method provided in an embodiment of this application, as shown below. Figure 1 As shown in the figure, the data processing method provided in this application embodiment may include steps S101 to S102, which are described in detail below.

[0050] S101. Convert the original rules expressed in natural language into intermediate rules expressed in intermediate syntax structure.

[0051] In this embodiment, the original rules are used to describe the configuration constraints of the bill of materials (BOM) and object dependencies. The BOM describes the component composition and quantity relationships of the product, while object dependencies describe the configuration constraints such as selection dependencies, mutual exclusions, and quantity constraints between components. The BOM and object dependencies together constitute the business rules for product configuration. For example, an original rule described in natural language might include selecting at least one SSD (Solid State Drive) and HDD (Hard Disk Drive). This original rule, described in natural language, describes the configuration constraints for storage device configuration and is a typical rule in a BOM selection scenario.

[0052] In this embodiment, the intermediate syntax structure is used to express complex logic for configuring at least one object to be configured. This complex logic consists of multiple basic logics, each expressing a constraint semantic in one dimension. That is, the expressive power of the intermediate syntax structure is not limited by the binary selection logic of the target system and can explicitly express complex logic in natural language.

[0053] Taking the original rule that includes selecting at least one of SSD and HDD as an example, it can be converted into an intermediate rule expressed in an intermediate syntax structure. The intermediate rule expressed in an intermediate syntax structure includes: LIMIT {SSD, HDD} COUNT >= 1, where LIMIT indicates that the original rule is a quantity constraint type, {SSD, HDD} indicates the set of objects to be configured, and COUNT >= 1 indicates the quantity constraint condition.

[0054] For example, a raw rule described in natural language might state: "If a 3.5-inch hard drive is selected, then a bracket must be selected." This raw rule describes the dependency relationship between components. This raw rule can be transformed into an intermediate rule expressed using an intermediate syntax structure: `Derived 3.5HDD → [BRACKET]`, where `Derived` identifies the rule as a dependency constraint type, `3.5HDD` identifies the dependent object, `→` indicates the dependency pointer, and `[BRACKET]` identifies the object being depended upon. Specifically, this intermediate rule involves two basic logics: `3.5HDD` and `BRACKET` respectively constitute candidate objects for a binary selection, belonging to binary selection; "If a 3.5-inch hard drive is selected, then a bracket must be selected" expresses the conditional triggering relationship between the two, belonging to dependency constraint. Therefore, this intermediate rule expressed using an intermediate syntax structure is used to express complex logic composed of both binary selection and dependency constraint basic logics.

[0055] S102. Convert the intermediate rules into executable rules expressed in the target syntax structure so that the target system can identify configuration constraints.

[0056] In this embodiment, the target syntax structure is used to express binary selection logic for configuring at least one object to be configured. It can be understood that the target syntax structure is a rule expression form supported by the target system, which only supports binary selection operations on configuration objects, that is, making a decision to select or not select each object to be configured.

[0057] Taking the intermediate rule LIMIT {SSD, HDD} COUNT >= 1 as an example, it expresses the complex logic of "at least one of SSD and HDD must be selected". Further, this intermediate rule is transformed into a combination of multiple binary selection rules expressed in the target syntax structure. Specifically, this intermediate rule can be transformed into a combination of the following binary selection logic:

[0058] If you choose SSD, you don't need to choose HDD. If you don't choose SSD, you must choose HDD.

[0059] This set of binary selection rules collectively expresses the original configuration constraint of "at least one SSD or HDD must be selected," which is then recognized by the target system. That is, after obtaining the executable rules expressed in the target syntax structure, the target system determines the configuration constraints related to the bill of materials and object dependencies by sequentially identifying each binary selection rule, and then executes the processing of these configuration constraints. For example, the R&D-side rule management system translates the configuration constraints related to the bill of materials and object dependencies described by binary selection rules into machine language for execution by the enterprise resource planning system, thereby achieving automated product configuration.

[0060] As can be seen from the above technical solution, the data processing method provided in this application decomposes the single-step direct conversion from natural language to the target grammatical structure into two stages by introducing an intermediate grammatical structure. The first stage maps the complex logical semantic understanding results in natural language to the intermediate grammatical structure, obtaining structured intermediate rules. Complex logic is explicitly expressed through the intermediate grammatical structure. The second stage performs deterministic grammatical structure mapping, which does not involve natural language understanding and does not introduce new semantic ambiguities. The error sources in the two stages are independent of each other, avoiding the coupling and superposition of semantic understanding errors and grammatical adaptation errors, thereby improving the accuracy of rule conversion.

[0061] It should be noted that the embodiments of this application can be executed by the target system or by the upstream system of the target system. That is, the target system can receive the original rules expressed in natural language and execute S101~S102 to obtain executable rules and then perform subsequent data processing. Alternatively, the upstream system can execute S101~S102 and then input the executable rules expressed in the target syntax structure into the target system, and the target system can identify the executable rules and perform subsequent data processing.

[0062] In an optional embodiment, S102, a specific implementation method for converting the original rules expressed in natural language into intermediate rules expressed in intermediate syntax structure, includes: inputting the original rules into a large language model to obtain the intermediate rules expressed in intermediate syntax structure output by the large language model.

[0063] In this embodiment, the large language model learns based on training corpora to establish a mapping relationship from natural language to intermediate grammatical structures. The training corpora include natural language rules and the corresponding intermediate grammatical structure expressions. For example, the natural language rule "at least one SSD or HDD should be selected" and its corresponding intermediate grammatical structure expression "LIMIT{SSD, HDD} COUNT >= 1" constitute one training sample, and the natural language rule "if a 3.5-inch hard drive is selected, then a bracket must be selected" and its corresponding intermediate grammatical structure expression "Derived 3.5HDD → [BRACKET]" constitute another training sample.

[0064] Specifically, the original rules of the natural language to be converted are input into a large language model that has been learned based on the training corpus. The large language model outputs the intermediate rules of the corresponding intermediate grammatical structure based on the established mapping relationship.

[0065] It should be noted that when inputting the original rules into the large language model, corresponding prompts can also be configured, such as "Please convert the following natural language rules into intermediate grammatical structures," to guide the large language model to understand that the current task is rule format conversion, thereby improving the accuracy of the output results.

[0066] As can be seen from the above technical solution, this solution directly maps natural language rules into intermediate grammatical structures using a large language model, eliminating the need for manually writing intermediate rules and improving the automation of rule conversion. Furthermore, because the intermediate grammatical structures are highly expressive and not constrained by the binary operations of the target system, the large language model only needs to complete the mapping from natural language semantics to structured expressions, reducing the risk of error aggregation caused by the coupling of semantic understanding and grammatical adaptation tasks.

[0067] In an optional embodiment, the data processing method provided in this application further includes a large language model training process, specifically, the training process includes:

[0068] The training corpus is obtained, and the prompt information is input into the large language model. The prompt information includes the training corpus and the target prompt words.

[0069] In this embodiment, the target prompt word is used to instruct the large language model to learn the mapping relationship between natural language and intermediate grammatical structures. For example, the target prompt word could be "Please learn the mapping relationship between the following natural language rules and intermediate grammatical structure expressions, and understand the correspondence between the two." Under the instruction of the target prompt word, the large language model takes the natural language rules in the training corpus as input and the corresponding intermediate grammatical structure expressions as the expected output. Through a large number of training samples, it learns the mapping rules, adjusts the model parameters, and finally establishes the ability to map from natural language to intermediate grammatical structures.

[0070] As can be seen from the above technical solutions, this solution guides the large language model to perform supervised fine-tuning through target prompt words, enabling the large language model to have the ability to accurately map from natural language to intermediate grammatical structures, thereby improving the accuracy and consistency of rule transformation of the large language model.

[0071] In one alternative embodiment, the intermediate syntax structure includes a combination of syntax elements of various basic logics, wherein the syntax elements of the basic logics include key characters and parameters, which are combined according to the syntax rules of the basic logics to express the basic logics. Specifically, key characters are used to identify the type of the basic logics, and parameters are used to identify the objects to be configured.

[0072] In this embodiment, the key characters are preset identifiers or operators with fixed semantics. For example, key characters include various keywords used to identify basic logic types, as shown in the following examples:

[0073] The keyword SELECT identifies binary choice logic, CONDITION identifies Boolean logic, LIMIT identifies quantity constraint logic, and DEPEND identifies dependency constraint logic.

[0074] In this embodiment, the key characters may also include operators used to express logical or quantitative relationships, as shown in the following example:

[0075] Logical AND operator &&, logical OR operator ||, quantity comparison operators >= and <=, dependency pointer operator →.

[0076] In this embodiment, the parameters include specific objects or values ​​involved in the basic logic, such as material codes, quantity thresholds, condition values, etc., which are used to identify the specific values ​​of the objects or constraints to be configured.

[0077] Taking quantity constraints as an example, the syntax rules corresponding to this basic logic require the combination of "LIMIT + {set of objects to be configured} + COUNT + quantity operator + quantity threshold" in the order of intermediate syntax expression to form the quantity constraint rules.

[0078] In one alternative embodiment, the underlying logic includes binary choice, Boolean logic, quantity constraints, dependency constraints, and feature constraints.

[0079] In this embodiment, binary selection is used to express whether an object to be configured is selected or not. Key characters and parameters of the binary selection logic are combined according to the syntax rules of binary selection logic to express the binary selection logic. Optionally, the key characters include the keyword SELECT (identifying the binary selection logic), the not-equal-to operator !=, and the equal-to-= operator. The parameters include the identifier of the object to be configured. The intermediate syntax structure obtained by combining the key characters and parameters according to the syntax rules to express the binary selection includes:

[0080] An intermediate syntax structure consisting of SELECT, the equality operator, and the identifier of the object to be configured is used to indicate that the object to be configured is selected. For example, the intermediate syntax structure SELECT = SSD1 indicates that SSD1 is selected.

[0081] The intermediate syntax structure consisting of SELECT, the inequality operator, and the identifier of the object to be configured is used to indicate that the object to be configured is not selected. For example, SELECT != HDD1 means that HDD1 is not selected.

[0082] In this embodiment, Boolean logic is used to express the logical operation relationship between at least two objects to be configured. The logical operation relationship includes a logical "AND" relationship and / or a logical "OR" relationship. Key characters and parameters of the Boolean logic are combined according to the syntax rules of Boolean logic to express the Boolean logic. Optionally, the key characters include the keyword CONDITION identifying the Boolean logic, the logical "AND" operator &&, and / or the logical "OR" operator ||, and the parameters include the identifiers of the objects to be configured. The intermediate syntax structure for expressing the Boolean logic obtained after combining the key characters and parameters according to the syntax rules includes:

[0083] An intermediate syntax structure consisting of CONDITION, parentheses, and identifiers of at least two objects to be configured connected by a logical OR operator within the parentheses, is used to indicate the selection of at least one of the at least two objects to be configured. For example, CONDITION (SSD || HDD) indicates the selection of SSD or HDD.

[0084] An intermediate syntax structure consisting of CONDITION, parentheses, and identifiers of at least two objects to be configured connected by a logical AND operator within the parentheses is used to indicate that at least two objects to be configured are selected simultaneously. For example, CONDITION(SSD && HDD) indicates that SSD and HDD are selected simultaneously.

[0085] In this embodiment, quantity constraints are used to express quantity selection constraints for the objects to be configured. Key characters and parameters of the quantity constraint logic are combined according to the syntax rules of quantity constraint logic to express the quantity constraint logic. Optionally, key characters include the keyword LIMIT identifying the quantity constraint logic, the quantity greater than or equal to operator >= and / or the quantity less than or equal to operator <=, and parameters include the identifier of the set of objects to be configured and the quantity threshold. The intermediate syntax structure for expressing quantity constraints obtained after combining key characters and parameters according to the syntax rules includes:

[0086] An intermediate syntax structure consisting of LIMIT, an identifier for the set of objects to be configured, COUNT, a quantity greater than or equal to operator, and a quantity threshold is used to indicate the lower limit of the number of objects to be selected in the set of objects to be configured. For example, LIMIT {SSD, HDD}COUNT >= 1 means that at least one SSD and one HDD should be selected.

[0087] An intermediate syntax structure consisting of LIMIT, an identifier for the set of objects to be configured, COUNT, a quantity less than or equal to operator, and a quantity threshold is used to indicate the upper limit of the number of objects to be selected in the set of objects to be configured. For example, LIMIT {SSD, HDD}COUNT <= 3 means that a maximum of 3 SSDs and HDDs can be selected.

[0088] In this embodiment, dependency constraints are used to express selection dependencies between multiple configurable objects. Key characters and parameters of the dependency constraint logic are combined according to the syntax rules of dependency constraint logic to express the dependency constraint logic. Optionally, the key characters include the keyword `Derived` that identifies the dependency constraint logic and the dependency pointer operator `→`, and the parameters include the identifiers of the dependent object and the dependent object. The intermediate syntax structure for expressing dependency constraints obtained by combining the key characters and parameters according to the syntax rules includes:

[0089] An intermediate syntax structure consisting of Derived, the identifier of the dependent object, the dependency pointer operator, and the identifier of the dependent object is used to indicate that if the dependent object is selected, the dependent object must also be selected. For example, Derived 3.5HDD →[BRACKET] means that if a 3.5-inch hard drive is selected, a bracket must also be selected.

[0090] In this embodiment, feature constraints are used to express feature selection constraints for the objects to be configured. Key characters and parameters of the feature constraint logic are combined according to the syntax rules of the feature constraint logic to express the feature constraint logic. Optionally, the key characters include the keyword LIMIT, which identifies the feature constraint logic, and the less-than-equal-to-number operator <=. The parameters include the identifier of the feature object set and the feature threshold. The intermediate syntax structure for expressing the feature constraints obtained after combining the key characters and parameters according to the syntax rules includes:

[0091] An intermediate syntax structure consisting of LIMIT, an identifier for the feature object set, COUNT, a quantity less than or equal to operator, and a feature threshold is used to represent the upper limit of the number of feature objects that can be selected based on product design features. For example, when generating corresponding selection constraints based on the hard disk Bay number feature, when the product design feature parameter is "hard disk Bay number is 4", LIMIT {HDD_SET} COUNT <= 4 means that the total number of hard disks does not exceed 4.

[0092] The five basic logics mentioned above are the core components of BOM / OD rules. In actual business rules, they can be combined as needed to express complex logical constraints. It should be noted that the key characters corresponding to each basic logic include multiple configurable preset identifiers or operators. The specific types and quantities can be flexibly configured according to the actual business scenario. The above embodiments are merely illustrative, and this application does not limit the scope of the embodiments.

[0093] For example, the composition rules expressed using intermediate syntax structures are:

[0094] IF ( (COUNTRY_REGIONGROUP="COMMERCIAL CEC GROUP") && ((DTHDD1_TYPE="3.5_HARD_DRIVE")|| (DTHDD2_TYPE="3.5_HARD_DRIVE"))&& (DTGRAPHICS="RTX3050_6GB_G6_96B_DVI+H+DP_HP,RTX3050_6GB_G6_96B_H+DP_HP,RTX4060_8GB_G6_128B_H+3DP_HP"))THEN(SELECT DTWIRELESS_LAN ≠ "NO_WIRELESS_LAN").

[0095] In this combined rule, `COUNTRY_REGIONGROUP="COMMERCIAL CEC GROUP"` is the intermediate syntax structure for the feature constraint; `(DTHDD1_TYPE="3.5_HARD_DRIVE") || (DTHDD2_TYPE="3.5_HARD_DRIVE")` is the intermediate syntax structure for the Boolean logical "OR" relation; and `DTGRAPHICS=""` is the intermediate syntax structure for the feature constraint. These three are combined using the `&&` (logical "AND" operator) to form the condition part. `SELECT DTWIRELESS_LAN ≠ "NO_WIRELESS_LAN"` is the intermediate syntax structure for the binary selection. The entire rule uses `IF THEN` to express the dependency constraint, indicating that the wireless network card cannot be empty when the aforementioned combination of conditions is met. Therefore, this intermediate rule is composed of four basic logical combinations: feature constraints, Boolean logic, binary selection, and dependency constraints, reflecting the structural characteristics of complex logic.

[0096] As can be seen from the above technical solution, this solution defines five basic logic types and their respective syntax rules through an intermediate syntax structure, so that the intermediate syntax structure can cover all the core constraint semantics of the BOM / OD rules.

[0097] In one alternative embodiment, a specific method for obtaining the original rules includes:

[0098] The original rules are obtained from the rule base, which records historical rules described in natural language, or the original rules are generated based on the multimodal feature data of the target product.

[0099] In this embodiment, obtaining the original rules from the rule base includes, in response to a rule conversion request, reading stored historical natural language rules from the rule base as the original rules to be converted. Optionally, the historical rules can be approved historical BOM / OD rules, or historical rules that have been successfully converted and executed, which can be directly reused without rewriting.

[0100] In this embodiment, multimodal feature data includes, but is not limited to, text design documents, product structure images, and voice parameter descriptions. When generating original rules based on the multimodal feature data of the target product, feature extraction is performed on the multimodal feature data. For example, text parsing is performed on the text design document, image recognition is performed on the product structure image, and voice recognition is performed on the voice parameter description to obtain structured product feature parameters, such as the number of hard drive bays, size, and material compatibility. Furthermore, based on the feature rule mapping knowledge base, the structured feature parameters are matched to generate corresponding natural language rules, which serve as the original rules. For example, the feature parameter "This product is equipped with 4 hard drive bays" is extracted from the product design document, and the corresponding natural language rule "The total number of hard drives does not exceed 4" is automatically generated based on the feature rule mapping knowledge base.

[0101] As can be seen from the above technical solutions, this solution obtains original rules through multiple methods such as reusing historical rules from the rule base, automatically generating rules from multimodal feature data, and direct user input, thereby expanding the diversity of original rule data sources. It also achieves automatic derivation from product design features to business rules through multimodal feature data, thus improving the efficiency of rule acquisition.

[0102] It should be noted that this solution also supports users to directly input natural language as the original rules, and the specific method of obtaining the original rules is not limited in the embodiments of this application.

[0103] In an optional embodiment, S102, a specific implementation method for converting intermediate rules into executable rules expressed in the target syntax structure, includes:

[0104] Based on the mapping relationship between the intermediate syntax structure and the target syntax structure, intermediate rules are mapped into executable rules.

[0105] In this embodiment, the target syntax structure is used to express binary selection logic for configuring at least one object to be configured. Since the target syntax structure can only express binary selection logic, while intermediate rules may contain basic logic such as quantity constraints and Boolean logic that cannot be directly expressed by the target syntax structure, it is necessary to map the intermediate rules into binary selection logic rules that the target syntax structure can recognize and process.

[0106] In this embodiment, the mapping relationship between the intermediate grammatical structure and the target grammatical structure is a preset deterministic mapping logic. Taking the quantity constraint LIMIT {SSD, HDD} COUNT >= 1 as an example, this intermediate rule expresses the quantity constraint semantics of "at least one of SSD and HDD must be selected," which cannot be directly expressed by the target grammatical structure that only supports binary selection logic. Based on a preset enumeration optimization algorithm, this intermediate rule can be mapped to a combination of the following binary selection rules:

[0107] If an SSD is selected, an HDD can be left out. If an SSD is not selected, an HDD must be selected. This set of binary selection rules together expresses the semantics of a "at least one selected" quantity constraint, meaning that both SSD and HDD cannot be left out simultaneously, thus equivalently implementing the original quantity constraint logic. Therefore, the complex logic in the intermediate rules is transformed into a combination of multiple binary selection rules through deterministic mapping, enabling the target system to recognize and execute the configuration constraints described by the original rules.

[0108] As can be seen from the above technical solution, this solution converts intermediate rules into binary selection logic rules that the target grammatical structure can recognize through a preset deterministic mapping relationship. Since this mapping process does not involve natural language understanding and only performs deterministic grammatical structure transformation, it does not introduce new semantic ambiguity and ensures the accuracy of the transformation.

[0109] It should be noted that after the large language model is trained, it can be deployed on the target system or its upstream system. After the compiler is trained and obtains mapping capabilities, it can also be deployed on the target system or its upstream system. It can be deployed on the same system as the large language model, or it can be deployed on different systems. This application does not limit this.

[0110] Taking the product configuration management scenario in the manufacturing industry as an example, the target system is the R&D side rule management system.

[0111] Figure 2a This is a schematic diagram of a system structure provided in an embodiment of this application. Figure 2a In one alternative embodiment, the large language model is deployed in the R&D-side rule management system. After receiving the original rules expressed in natural language, the R&D-side rule management system converts the original rules described in natural language into intermediate rules expressed in intermediate syntax structure through the large language model deployed locally. The intermediate rules are then converted into executable rules expressed in target syntax structure by a compiler. Furthermore, the executable rules are converted into machine language adapted to the downstream system by the language adaptation module corresponding to the downstream system and synchronized to the downstream system (i.e., the enterprise resource planning system) so that the enterprise resource planning system can configure products according to the bill of materials and object relevance rules described in the original rules.

[0112] Figure 2b This is a schematic diagram of a system structure provided in an embodiment of this application. Figure 2b In another alternative embodiment, the large language model is deployed on an upstream system of the target system. This upstream system is a rule transformation system deployed independently of the R&D-side rule management system. The rule transformation system receives the original rules expressed in natural language, transforms them into intermediate rules expressed in an intermediate syntax structure using the locally deployed large language model, and then uses a compiler to convert the intermediate rules into executable rules expressed in the target syntax structure. These executable rules are then input into the R&D-side rule management system. Upon receiving the executable rules, the R&D-side rule management system transforms them into machine language adapted to the downstream system (i.e., the enterprise resource planning system), and synchronizes them to the downstream system (i.e., the enterprise resource planning system). The enterprise resource planning system then configures the product according to the bill of materials and object-related rules described in the original rules.

[0113] It should be noted that the large language model and compiler can also be deployed separately on the upstream and target systems, respectively, to independently complete the conversion process from natural language to intermediate grammatical structures and then to the target grammatical structure. This avoids the low conversion accuracy caused by the coupling and superposition of semantic understanding errors and grammatical adaptation errors, thereby improving the accuracy of rule conversion. The target system converts the executable rules into machine language and synchronizes them to the downstream system for execution. Multiple deployment options can flexibly adapt to the system architecture requirements of different enterprises.

[0114] In an optional embodiment, the data processing method provided in this application further includes a syntax verification process. Specifically, the syntax verification process includes: performing syntax verification on intermediate rules based on the syntax rules of the intermediate syntax structure.

[0115] In this embodiment, after the original rule is converted into an intermediate rule expressed in an intermediate syntax structure, and before the intermediate rule is converted into an executable rule expressed in a target syntax structure, the intermediate rule is syntax-validated.

[0116] In this embodiment, syntax validation includes checking whether intermediate rules conform to the syntax rules of the intermediate syntax structure. Specifically, it verifies whether the key characters in the intermediate rules are preset legal key characters, such as whether characters like SELECT, CONDITION, LIMIT, and DEPEND are keywords supported by the intermediate syntax structure, and whether operators such as &&, ||, >=, <=, and → are operators supported by the intermediate syntax structure. It also verifies whether the parameters are complete, such as whether the quantity constraint rule contains the set of objects to be configured and the quantity threshold, and whether the binary selection rule contains the identifier of the objects to be configured. Finally, it verifies whether the combination order of each syntax element conforms to the syntax rules of the corresponding basic logic.

[0117] In this embodiment, syntax validation also includes checking for logical conflicts in intermediate rules. Specifically, it checks for logical contradictions between multiple intermediate rules, such as the same object to be configured being required to be selected and not selected simultaneously, or contradictions between quantity constraints, such as "select at least 3" and "select at most 2" simultaneously applying to the same set of objects to be configured.

[0118] If the validation fails, a prompt message is generated requesting the user to correct the intermediate rules, or the system automatically corrects the intermediate rules. If the validation passes, the intermediate rules are sent to the subsequent target syntax structure transformation process.

[0119] As can be seen from the above technical solution, this solution can detect and correct syntax errors and logical conflicts in intermediate rules in a timely manner before compilation by performing syntax verification on intermediate rules, ensuring that the intermediate rules entering the compiler are compliant, avoiding the generation of invalid executable rules due to errors in intermediate rules, and improving the reliability and stability of rule transformation.

[0120] Based on the above embodiments, see Figure 3 , Figure 3 This is a flowchart illustrating another data processing method provided in an embodiment of this application. Figure 3 The illustration shows a specific implementation flow of a data processing method executed based on a data processing system in a manufacturing product configuration management scenario, in one alternative embodiment.

[0121] In this embodiment, the data processing system includes an interaction layer, a multimodal feature extraction layer, a semantic conversion layer, a verification layer, a compilation layer, a language adaptation layer, and a source tracing management layer.

[0122] like Figure 3 As shown, a data processing system can obtain the original rules expressed in natural language in two ways.

[0123] Method 1: The interaction layer receives the original rules expressed in natural language, which can be in the form of voice and / or text input by the R&D personnel. If the input is in the form of voice, the voice recognition module converts the voice into text and performs text format standardization processing to obtain the original rules expressed in natural language.

[0124] Method 2: A multimodal feature extraction layer extracts features from the target product's feature data to obtain structured product feature parameters. Based on a pre-defined feature-rule mapping knowledge base, it generates original rules expressed in natural language. The product feature data includes at least one of the following: text design documents, product structure images, and voice parameter descriptions. The extracted product feature parameters are validated, and after confirming their rationality, original rules expressed in natural language are generated.

[0125] After obtaining the original rules, they are input into the semantic transformation layer for semantic transformation, generating intermediate rules expressed in an intermediate grammatical structure, and outputting the resolution confidence score. If ambiguity exists or the confidence score is lower than a preset threshold, the ambiguity clarification process is initiated, where R&D personnel confirm or correct the rules before re-performing the semantic transformation. If there is no obvious ambiguity, the intermediate rules are input into the validation layer.

[0126] In the validation layer, the intermediate rules are validated for syntax and logical conflicts based on the syntax rules of the intermediate syntax structure. If the validation fails, the developers manually correct it on the interactive page and then validate it again. If the validation passes, a visual preview is generated for the developers to confirm. After the developers confirm, the intermediate rules are input into the compilation layer.

[0127] In the compilation layer, based on the mapping relationship between the intermediate syntax structure and the target syntax structure, intermediate rules are mapped into executable rules expressed in the target syntax structure. The compilation layer has a built-in enumeration optimization algorithm that can automatically enumerate complex logic into binary selection logic combinations, achieving accurate transformation into binary selection logic rules.

[0128] like Figure 3 As shown, after obtaining executable rules through the compilation layer, the target system transforms the executable rules into machine language adapted to the downstream system through the language adaptation layer and synchronizes them to the downstream system so that the downstream system can configure the product according to the bill of materials and object-related rules described in the original rules.

[0129] like Figure 3 As shown, the traceability management layer records the entire transformation log from the original rule to the intermediate rule and then to the executable rule, and establishes traceability associations between the original rule, intermediate rule and executable rule, supporting rule version rollback and cross-system rule association.

[0130] As can be seen from the above technical solutions, by constructing a multi-level modular system architecture, it supports two methods of obtaining original rules: interactive layer input and multimodal feature extraction. This achieves a high-accuracy automated conversion of natural language rules into executable rules for the target system, while also realizing full-link traceability and rule version management.

[0131] The above describes a data processing method provided by an embodiment of this application. The following describes an apparatus for performing the above data processing method.

[0132] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application. Figure 4 As shown, the data processing device 400 includes a semantic recognition unit 401 and a syntax compilation unit 402.

[0133] The semantic recognition unit 401 is used to convert the original rules expressed in natural language into intermediate rules expressed in an intermediate syntax structure. The original rules are used to describe the configuration constraints of the bill of materials and object relevance. The intermediate syntax structure is used to express the complex logic of configuring at least one object to be configured. The complex logic is composed of multiple basic logics.

[0134] The syntax compilation unit 402 is used to convert the intermediate rules into executable rules expressed in a target syntax structure, so that the target system can recognize the configuration constraints. The target syntax structure is used to express binary selection logic for configuring at least one object to be configured.

[0135] In one possible implementation, when the semantic recognition unit 401 is used to convert the original rule expressed in natural language into an intermediate rule expressed in an intermediate grammatical structure, it is specifically used to: input the original rule expressed in natural language into a large language model to obtain the intermediate rule expressed in the intermediate grammatical structure output by the large language model; wherein, the large language model learns based on training corpus to establish a mapping relationship from natural language to the intermediate grammatical structure, and the training corpus includes natural language rules and intermediate grammatical structure expressions corresponding to the natural language rules.

[0136] In one possible implementation, the semantic recognition unit 401 is further configured to: obtain the training corpus; input prompt information into the large language model, the prompt information including the training corpus and a target prompt word, the target prompt word being used to instruct the large language model to learn the mapping relationship from natural language to the intermediate grammatical structure.

[0137] In one possible implementation, the intermediate syntax structure includes a combination of syntax elements of various basic logics, wherein the syntax elements of the basic logics include key characters and parameters, and the key characters and parameters are combined according to the syntax rules of the basic logics to express the basic logics; wherein the key characters are used to identify the type of the basic logics, and the parameters are used to identify the object to be configured.

[0138] In one possible implementation, the basic logic includes the following types: binary selection, used to express the selection or non-selection of the object to be configured; Boolean logic, used to express the logical operation relationship between at least two objects to be configured, the logical operation relationship including logical "AND" relationship and / or logical "OR" relationship; quantity constraint, used to express the quantity selection constraint of the objects to be configured; dependency constraint, used to express the selection dependency relationship between multiple objects to be configured; feature constraint, used to express the feature selection constraint of the objects to be configured.

[0139] In one possible implementation, when the semantic recognition unit 401 obtains the original rule, it is specifically used to: obtain the original rule from a rule base, the rule base being used to record historical rules described in natural language; or, generate the original rule based on the multimodal feature data of the target product.

[0140] In one possible implementation, when the syntax compilation unit 402 is used to convert the intermediate rule into an executable rule expressed in the target syntax structure, it is specifically used to: map the intermediate rule into the executable rule based on the mapping relationship between the intermediate syntax structure and the target syntax structure.

[0141] In one possible implementation, the semantic recognition unit 401 is further configured to: perform grammatical verification on the intermediate rules based on the grammatical rules of the intermediate grammatical structure.

[0142] It should be noted that the specific implementation methods of the above-mentioned units can be referred to the relevant descriptions in the foregoing embodiments, and will not be repeated here.

[0143] This application also provides an electronic device, which includes at least one processor and a memory connected to the processor. The memory is used to store a computer program. The processor is used to execute the computer program so that the electronic device can implement a data processing method provided in this application, as follows:

[0144] The original rules expressed in natural language are converted into intermediate rules expressed in an intermediate syntax structure. The original rules are used to describe the configuration constraints of the bill of materials and object relevance. The intermediate syntax structure is used to express the complex logic of configuring at least one object to be configured. The complex logic consists of multiple basic logics.

[0145] The intermediate rules are converted into executable rules expressed in a target syntax structure so that the target system can recognize the configuration constraints. The target syntax structure is used to express binary selection logic for configuring at least one object to be configured.

[0146] In an optional implementation, the processor may also implement any of the steps in the foregoing method embodiments when executing the program, as detailed in the foregoing method embodiments, which will not be repeated here.

[0147] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 5A schematic diagram of an electronic device suitable for implementing the data processing method in the embodiments of this application is shown. The electronic device in the embodiments of this application may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 5 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0148] like Figure 5 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. When the electronic device is powered on, the RAM 503 also stores various programs and data required for the operation of the electronic device. The processing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0149] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, memory cards, hard drives, etc.; and communication devices 509. Communication device 509 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have instead.

[0150] This application also provides a computer program product, including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the data processing methods provided in this application.

[0151] This application also provides a computer-readable storage medium that carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the data processing methods provided in this application.

[0152] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0153] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0154] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0155] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

Claims

1. A data processing method, comprising: The original rules expressed in natural language are converted into intermediate rules expressed in an intermediate syntax structure. The original rules are used to describe the configuration constraints of the bill of materials and object relevance. The intermediate syntax structure is used to express the complex logic of configuring at least one object to be configured. The complex logic consists of multiple basic logics. The intermediate rules are converted into executable rules expressed in a target syntax structure so that the target system can recognize the configuration constraints. The target syntax structure is used to express binary selection logic for configuring at least one object to be configured.

2. The data processing method according to claim 1, which converts the original rules expressed in natural language into intermediate rules expressed in intermediate syntax structure, includes: The original rules, expressed in natural language, are input into the large language model to obtain the intermediate rules, expressed in the intermediate syntax structure, output by the large language model. The large language model learns based on training corpus to establish a mapping relationship from natural language to the intermediate grammatical structure. The training corpus includes natural language rules and intermediate grammatical structure expressions corresponding to the natural language rules.

3. The data processing method according to claim 2 further includes: Obtain the training corpus; The prompt information is input into the large language model. The prompt information includes the training corpus and the target prompt word. The target prompt word is used to instruct the large language model to learn the mapping relationship from natural language to the intermediate grammatical structure.

4. The data processing method according to claim 1, wherein the intermediate syntax structure comprises a combination of syntax elements of various basic logics, wherein the syntax elements of the basic logics comprise key characters and parameters, and the key characters and the parameters are combined according to the syntax rules of the basic logics to express the basic logics; in, The key characters are used to identify the type of the basic logic, and the parameters are used to identify the object to be configured.

5. The data processing method according to claim 4, wherein the basic logic includes the following types: Binary selection is used to express whether the configuration object is selected or not. Boolean logic is used to express logical operations between at least two objects to be configured, including logical AND and / or logical OR relationships. Quantity constraints are used to express constraints on the number of objects to be configured. Dependency constraints are used to express the selection dependencies between multiple objects to be configured; Feature constraints are used to express the feature selection constraints of the object to be configured.

6. The data processing method according to claim 5, wherein the original rules are obtained in the following ways: The original rule is obtained from a rule base, which is used to record historical rules described in natural language; Alternatively, the original rules can be generated based on the multimodal feature data of the target product.

7. The data processing method according to claim 1, wherein converting the intermediate rules into executable rules expressed in a target syntax structure includes: Based on the mapping relationship between the intermediate syntax structure and the target syntax structure, the intermediate rule is mapped to the executable rule.

8. The data processing method according to claim 1, further comprising: Based on the syntax rules of the intermediate syntax structure, the intermediate rules are subjected to syntax validation.

9. A data processing apparatus, comprising: The semantic recognition unit is used to convert the original rules expressed in natural language into intermediate rules expressed in an intermediate syntax structure. The original rules are used to describe the configuration constraints of the bill of materials and object relevance. The intermediate syntax structure is used to express the complex logic of configuring at least one object to be configured. The complex logic consists of multiple basic logics. A syntax compilation unit is used to convert the intermediate rules into executable rules expressed in a target syntax structure, so that the target system can recognize the configuration constraints. The target syntax structure is used to express binary selection logic for configuring at least one object to be configured.

10. An electronic device comprising at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program to enable the electronic device to perform: The original rules expressed in natural language are converted into intermediate rules expressed in an intermediate syntax structure. The original rules are used to describe the configuration constraints of the bill of materials and object relevance. The intermediate syntax structure is used to express the complex logic of configuring at least one object to be configured. The complex logic consists of multiple basic logics. The intermediate rules are converted into executable rules expressed in a target syntax structure so that the target system can recognize the configuration constraints. The target syntax structure is used to express binary selection logic for configuring at least one object to be configured.