Intelligent script generation method based on intelligent IC card making
Through an intelligent parameter configuration system and digital twin testing and verification, the problems of low efficiency, high cost and poor flexibility in the traditional card production process have been solved, realizing efficient and flexible automated card production process that can adapt to rapid business changes.
Patent Information
- Application Number
- CN202511355798.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-22
- Publication Date
- 2026-02-03
AI Technical Summary
Traditional card production processes rely on manual parameter configuration, which is inefficient and prone to errors. Rule updates are lagging behind and cannot adapt to the needs of rapid business iteration. Card function verification is costly and inflexible, and cannot cope with complex or changing needs.
By deeply integrating artificial intelligence and digital twin technology, an intelligent parameter configuration system is constructed. Knowledge graphs and reinforcement learning are used to optimize the model, achieving full-process automated control. Combined with multimodal large language models and digital twin testing and verification, card production scripts that meet current needs are generated.
Significantly improves card production efficiency, reduces manual intervention, enables rapid response to business changes, reduces testing costs, enhances the flexibility and accuracy of parameter configuration, and supports automated processing of complex requirements.
Smart Images

Figure CN121455474A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of smart card manufacturing, in particular to an intelligent script generation method based on smart IC card manufacturing, which is suitable for smart card production scenarios in the financial, transportation, communication and other industries. BACKGROUND
[0002] The intelligent innovation of the traditional card manufacturing process is driven by the reconstruction of the system with the fusion of multiple technologies, which realizes the intelligent collaboration and conflict resolution of cross-domain technical parameters by building a parameter configuration knowledge graph and a dynamic optimization model of reinforcement learning, and transforms the dependence on artificial experience into data-driven automatic decision-making. Problems existing in the prior art: 1. Relying on manual parameter configuration, low efficiency and prone to errors. Manual intervention is required to supplement key configuration items during card manufacturing, including but not limited to downloading program parameters, chip module operation instruction set adaptation, security domain division, etc. The bottom logic of card manufacturing modules, leading to repeated development content, differences in understanding of script configuration rules by different developers (such as data block sorting, mapping strategy) are prone to cause configuration habitual differences, especially new developers are prone to miss parameters due to lack of experience.
[0004] 2. Rule update lags behind, unable to adapt to rapid iteration needs. The existing rule library may not be updated in time, resulting in that the card manufacturing process cannot keep up with business changes.
[0005] 3. Card manufacturing script generation based on static rule library. The current card manufacturing is based on static rule library, which is not flexible enough to cope with complex or changing needs.
[0006] 4. Card function verification requires manual testing, high cost. The card function needs to be tested manually, which is time-consuming and labor-intensive, and the test cases may not be fully covered, which is prone to defects. SUMMARY
[0007] In view of the deficiencies existing in the prior art, the present application provides an intelligent script generation method based on smart IC card manufacturing, which builds a new generation of intelligent card manufacturing technology system through the deep integration of artificial intelligence and digital twin technology, effectively solves the problems of low efficiency, high cost and poor flexibility of traditional card manufacturing methods, and has significant economic benefits and social value.
[0008] The present application realizes the above-mentioned purposes through the following technical solutions: An intelligent script generation method based on smart IC card manufacturing, comprising: An intelligent script generation method based on smart IC card manufacturing, comprising: An intelligent parameter configuration system is constructed by using a dual-core driving architecture including a knowledge graph business rule base and a reinforcement learning optimization model, wherein the knowledge graph construction layer is used to integrate industry standards, historical configuration parameters and equipment technical manuals, form a parameter relationship graph, and monitor industry standard updates in real time to perform static conflict detection; the reinforcement learning decision layer uses a reinforcement learning algorithm to model the environment state, dynamically adjusts parameters or enables rules, and realizes an automated decision-making process from demand input to optimal parameter output. By using an incremental learning mechanism, card manufacturing results and verification data are automatically collected after each card manufacturing cycle, and these new data are injected into the model training process in real time, the model parameters are updated by using an incremental learning algorithm, and a dynamic rule knowledge base is generated. Based on a multi-modal large language model, combined with a professional knowledge base in the card manufacturing field and a dynamic interaction mechanism, the large language model is adapted to the specific requirements of the card manufacturing field by using field adaptation pre-training and parameter fine-tuning technology, and a card manufacturing script that meets the current requirements is generated.
[0009] According to the intelligent script generation method for intelligent IC card manufacturing provided by the application, a virtual image of the card function is constructed through a digital twin test verification system, the full life cycle process of the real card is simulated, including hardware, protocol and application function, and test cases are automatically executed in a sandbox environment, the simulation verification of the full life cycle process is realized, a test report is automatically generated, and the test results, problem summary and improvement suggestions are included.
[0010] According to the intelligent script generation method for intelligent IC card manufacturing provided by the application, the knowledge graph construction layer includes: A data integration module is used to integrate multiple rule data sources, including at least structured data and unstructured data of industry standards, historical configuration parameters and equipment technical manuals, to form a comprehensive rule and parameter relationship graph; A relationship analysis module is used to check and analyze the compatibility, dependency relationship, conflict rules and constraint rules between parameters, and a knowledge graph is constructed based on the complex relationship between multiple rules and parameters, wherein each node represents a parameter or rule, and the edge represents the relationship between them; A real-time monitoring and updating module is used to continuously monitor the dynamic changes of industry standards, and when an update is detected, a graph traversal mechanism is automatically triggered to directly determine whether there is a parameter configuration in the existing graph that conflicts with the new standard by using a preset static conflict detection rule; A conflict prediction module uses neural network technology to automatically predict potential rule conflicts in the configuration path, and by learning historical conflict data and parameter relationships, possible conflict points are identified and warned in advance to optimize the parameter configuration process and reduce the cost of later debugging.
[0011] The application provides an intelligent script generation method based on intelligent IC card card manufacturing, and the reinforcement learning decision layer comprises: A decision model training module trains the decision model by using a reinforcement learning algorithm to learn the optimal parameter configuration strategy under different environment states. An environment state modeling module models the environment state by using a hybrid decision mechanism, which is used to convert the current system state into an input format suitable for the reinforcement learning algorithm and adjust the parameters or enable specific rules in the dynamic space according to the policy requirements. An action effect evaluation module defines and evaluates the effect of each action after execution, including at least the rationality of parameter configuration, the improvement of system performance, the reduction of error rate and other indicators, to quantitatively evaluate the effect of reinforcement learning decision. An action legality verification module directly verifies the legality of the action by interacting with the knowledge graph construction layer when the agent receives the current state and generates the action, and immediately blocks the action that is incompatible or violates the preset rules, to ensure that the generated parameter configuration meets the business logic and industry standards. A reward feedback and model updating module receives the reward signal Rt and the new state St+1 from the environment feedback, and updates the policy network and the value network based on the reward signal. A parameter configuration generation and packaging module generates the optimal parameter configuration based on the trained decision model, and structures and packages the parameter data into a standard format for sending to the card manufacturing production system for execution. A real-time feedback and interaction interface is used to feed back the generated parameter configuration to the dynamic interaction interface in real time.
[0012] The application provides an intelligent script generation method based on intelligent IC card card manufacturing, and a dynamic interaction interface is set as a communication bridge between the knowledge graph construction layer and the reinforcement learning decision layer, and the dynamic interaction interface comprises: A data and rule delivery unit is used to obtain the rules and data required for parameter configuration from the knowledge graph construction layer, including at least industry standards, historical configuration parameters, device technical specifications and parameter relationship graph, and deliver these information in a structured format to the reinforcement learning decision layer. A state synchronization unit realizes the synchronous updating of the states of the knowledge graph construction layer and the reinforcement learning decision layer by using a bidirectional data exchange mechanism. A decision result feedback unit receives the parameter configuration decision result generated by the reinforcement learning decision layer, and feeds back these results to the knowledge graph construction layer, to verify the effectiveness of the decision and further optimize the rules and parameter relationships in the knowledge graph; at the same time, the construction strategy of the knowledge graph is adjusted according to the feedback result, to form a closed-loop optimization mechanism.
[0013] According to the intelligent IC card card making intelligent script generation method provided by the application, after generating a dynamic rule knowledge base, based on the function rules in the current version requirement, the dynamic rule knowledge base drives the cognitive script generator in the card making production system to automatically generate card making scripts that meet the current business requirements; wherein, the dynamic rule knowledge base is continuously updated and optimized through incremental learning mechanism according to real-time collected card making results and verification data, to ensure that the generated script adapts to business changes; The system verifies the generated script in the sandbox environment or simulation test environment, and feeds back the verification result to the incremental learning engine in real time; the incremental learning engine adjusts the rules and parameters in the dynamic rule knowledge base according to the feedback result, realizes the self-optimization and iteration of the script generator; The card making production system analyzes the function points of the generated script, automatically calls VSCode AI or other code generation tools, and generates corresponding component program code according to the script requirements; Integrate the code quality verification tool StarCoder or other equivalent tools in the integrated development environment IDE, and perform static and dynamic code quality analysis on the generated component program code, including at least syntax checking, logic error detection, performance evaluation and security vulnerability scanning, to ensure that the generated code meets the predetermined quality standards and business requirements.
[0014] According to the intelligent IC card card making intelligent script generation method provided by the application, the digital twin test verification system comprises: The digital twin model layer is used to build a virtual card model, which is used to simulate the hardware characteristics, communication protocol and application function of the real IC card; support dynamic adjustment of model parameters, at least including chip type, radio frequency parameter, encryption algorithm, transaction protocol and card payment logic; at the same time, the model layer can simulate the complete life cycle process of IC card from issuance to cancellation, and generate virtual transaction data for testing the performance of card in different scenarios; The sandbox environment layer is integrated with automatic test strategy, which is used to simulate the operation environment of contact / non-contact reader; the environment layer automatically executes the pre-designed test cases, records the test results, and connects the digital twin model layer and the real system to realize the bidirectional transmission of data; at the same time, it records each operation and abnormal event in the test process in real time; The automatic test tool automatically deduces the test path based on the information simulated by the digital twin model layer, and counts the proportion of function modules covered by the test cases; quickly locate the problems found in the test process, generate detailed repair suggestions; and automatically generate a test report containing test results, problem summary and improvement suggestions to support continuous optimization and quality control of card making process.
[0015] The application provides a smart script generation method based on smart IC card manufacturing, and the steps of interaction between an agent and an environment in a reinforcement learning decision layer process specifically include: The agent receives a current system state St at each decision time t, and the state is expressed in a vector form St = [s1, s2,..., s n ] where s i represents an i-th state characteristic parameter. The agent also receives a candidate action At generated based on a current strategy, and the action is expressed in a vector form At = [a1, a2,..., a m ] where a j represents a j-th action dimension parameter. The agent verifies the legality of the candidate action At by calling a knowledge graph verification interface, and the verification logic is based on a pre-constructed parameter compatibility rule library. If the action contains incompatible chip models or rules that violate business constraints, the verification function is expressed as χ(At) ∈ {0, 1}, where χ(At) = 0 represents an illegal action, and the action is immediately blocked from execution and triggers a strategy re-planning. After the execution of the legal action, the environment returns an immediate reward Rt and a next state St+1, where the reward value is calculated by a multi-objective weighting function: Rt = w1·R_performance(St,At) + w2·R_safety(St,At) + w3·R_cost(St,At) where R_performance represents a performance improvement reward, which is positively correlated with card manufacturing efficiency; R_safety represents a safety reward, which is negatively correlated with the number of parameter conflicts; R_cost represents a cost optimization reward, which is negatively correlated with resource consumption; w1, w2, and w3 are weight coefficients, and satisfy w1+ w2+ w3= 1. The strategy network π(St) outputs an action probability distribution based on the current state, and the value network V(St) evaluates the state value, and the update formula is: θ_π ← θ_π + α·▽θ_π logπ(At|St)·(Rt + γ·V(St+1) - V(St)) θ_V ← θ_V + β·▽θ_V (Rt + γ·V(St+1) - V(St)) 2 where θ_π and θ_V are parameters of the strategy network and the value network respectively; α and β are learning rates; γ is a discount factor, and the value range is (0, 1]; and ▽ represents a gradient operator.
[0016] According to the application, a smart script generation method based on smart IC card card making is provided, and a script generation and optimization method based on a multi-modal large language model specifically includes: From a candidate large language model set M = {Claude, ChatGPT, Bloom, Llama,...}, an optimal basic model is selected based on a card making field performance evaluation index Wherein the evaluation function is defined as:
[0017] Wherein, P sem is the semantic understanding accuracy, which is calculated by testing set question and answer tasks; P code is the code generation accuracy, which is measured by the unit test pass rate; K domain is the field knowledge coverage, which is evaluated based on the knowledge graph question and answer accuracy; α , β , gamma is a weight coefficient, satisfying α + β + gamma =1; The domain adaptation pre-training DAPT technology is adopted, the general LLM is used as the basis, and the card making industry technical document set D = {d1, d2,..., d n} is used for continuous pre-training, and the optimization target is to minimize the field language model loss function:
[0018] Wherein, p θ is the conditional probability distribution when the model parameter is θ; t is the token sequence in the document.
[0019] According to the application, a smart script generation method based on smart IC card card making is provided, and the LoRA technology is used to fine-tune the pre-training model, and the weight matrix is decomposed into a low-rank matrix: Δ W = AB T Wherein, A ∈R d × r , B ∈R r × d , r << d is the low-rank dimension; only the A and B matrix parameters are updated in the fine-tuning process, and the original model parameters are kept frozen; The newly generated script S nAfter digital twin test verification, the feature vector thereof is extracted v n The feature dimension includes:
[0020] Wherein, f syntax The syntax correctness feature is 0 / 1 coding; f logic The logical coverage is calculated by the control flow graph node coverage; f perf The performance index is the execution time normalized value; f sec The security score is based on the vulnerability scanning result; The feature vector v n is stored in the version library V together with the script metadata, and a script inheritance relationship graph G = (S, E) is established, wherein the edge e ij ∈ E represents the optimization relationship of the script S i to S j , and the weight is defined as: Wherein, the denominator is the Euclidean distance of the feature vector, and the script framework reuse recommendation based on semantic similarity is realized.
[0021] Therefore, compared with the prior art, the intelligent script generation method based on intelligent IC card manufacturing proposed by the present application has the following beneficial effects: 1. The conflict pre-detection mechanism of the knowledge graph in the present application converts the trial-and-error mode of traditional manual parameter configuration into automatic decision-making, significantly reducing the time for manual repeated proofreading. Combined with the reinforcement learning algorithm, the dynamic adjustment of parameter priority and the real-time resolution of rule conflicts are realized, so that the configuration process is changed from "experience-driven" to "data-driven".
[0022] 2. The present application combines multi-modal large language models and domain parameter fine-tuning technology, breaks through the "zero writing" mode of traditional script development, realizes intelligent reuse of script framework through extraction of historical script feature vectors and version library management, reduces the cost of repeated development, and improves the demand response speed. At the same time, the domain adaptation ability of the multi-modal large language model enables the script generator to process unstructured demand description. Through natural language processing technology, the colloquial demands of business personnel are converted into executable scripts, reducing the technical communication threshold.
[0023] 3. The virtual card environment built by digital twin modeling replaces the item-by-item verification mode of traditional physical test cards. The full-life-cycle simulation test in the sandbox environment upgrades the test path planning from "manual design" to "automatic derivation", significantly shortening the test cycle. The virtual test environment replaces most physical test cards, reducing the consumption of materials such as plastic. The automated decision system reduces the dependence on senior technical personnel and optimizes the allocation of human resources.
[0024] 4. The industry standards and historical data integrated by the knowledge graph predict potential rule conflicts through neural networks, improving the fault tolerance of parameter configuration to an industry-leading level. The reinforcement learning decision model dynamically models the environmental state to ensure that the generated parameter combinations meet the constraints of complex business scenarios. The multi-parameter relationship integrated by the knowledge graph construction layer supports the rapid access of new chips and protocols. The design of the dynamic interaction interface enables the system to be compatible with hardware devices from different manufacturers, improving supply chain collaboration efficiency.
[0025] 5. The cognitive intelligent script generator combined with the incremental learning mechanism ensures that the generated scripts meet both general specifications and individualized needs. Through continuous optimization of verification feedback, the consistency of script logic and business rules is ensured, reducing the risk of field deployment. The dynamic rule knowledge base supported by the incremental learning mechanism breaks through the update bottleneck of traditional static rule bases, and the second-level update capability of business rules enables the card production process to quickly respond to changes in industry standards and customer demand iterations.
[0026] 6. The real transaction environment simulated by the digital twin system covers the full life-cycle scenarios from card activation to cancellation. The intelligent path derivation of the automated test tool enables the dynamic expansion of the test case library, improving the detection capability of edge scenarios.
[0027] The application will be described in further detail below with reference to the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0028] Figure 1 is a flowchart of an embodiment of the intelligent script generation method for smart IC card production according to the present application.
[0029] Figure 2 is a functional diagram of the card production system in an embodiment of the intelligent script generation method for smart IC card production according to the present application.
[0030] Figure 3 is a functional architecture diagram of the intelligent parameter configuration engine in an embodiment of the intelligent script generation method for smart IC card production according to the present application.
[0031] Figure 4 is a flowchart of the reinforcement learning training in an embodiment of the intelligent script generation method for smart IC card production according to the present application.
[0032] Figure 5 is a flowchart of an incremental learning algorithm in an embodiment of the intelligent script generation method based on smart IC card production of the application.
[0033] Figure 6 is a functional architecture diagram of the intelligent script generation engine in an embodiment of the intelligent script generation method based on smart IC card production of the application.
[0034] Figure 7 is a logic diagram of the script generation core implementation in an embodiment of the intelligent script generation method based on smart IC card production of the application.
[0035] Figure 8 is a functional architecture diagram of digital twin testing in an embodiment of the intelligent script generation method based on smart IC card production of the application.
[0036] Figure 9 is a flowchart of digital twin testing in an embodiment of the intelligent script generation method based on smart IC card production of the application. DETAILED DESCRIPTION
[0037] In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be described clearly and completely below in conjunction with the drawings in the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0038] In this document, reference to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are they necessarily mutually exclusive of one another. Those skilled in the art will appreciate that embodiments described herein can be combined with other embodiments.
[0039] Referring to Figure 1 , the present embodiment provides an intelligent script generation method based on smart IC card production, comprising: Step S1, different interfaces in the card production system are called by the artificial intelligence agent, and the whole process automation control of parameter configuration, script generation, component program generation, automatic card production and card testing is realized in a modular manner, as shown in Figure 2 ; Step S2, an intelligent parameter configuration system is constructed using a dual-core driven architecture comprising a knowledge graph business rule base and a reinforcement learning optimization model. The knowledge graph construction layer is used to integrate industry standards, historical configuration parameters, and equipment technical manuals to form a parameter relationship graph, and to monitor industry standard updates in real time for static conflict detection. The reinforcement learning decision layer uses a reinforcement learning algorithm to model the environment state, dynamically adjusts parameters or enables rules, and realizes an automated decision-making process from demand input to optimal parameter output. Step S3, using an incremental learning mechanism, card production results and verification data are automatically collected at the end of each card production cycle, and these new data are injected into the model training process in real time. The model parameters are updated through an incremental learning algorithm to generate a dynamic rule knowledge base. Step S4, based on a multi-modal large language model, combined with a professional knowledge base in the card production field and a dynamic interaction mechanism, the large language model is adapted to the specific needs of the card production field through field adaptation pre-training and parameter fine-tuning technology, and a card production script that meets the current needs is generated.
[0040] Step S5, a digital twin test verification system is used to construct a virtual image of the card function, simulate the full life cycle process of the real card, including hardware, protocol, and application function, and automatically execute test cases in a sandbox environment to realize simulation verification of the full life cycle process, automatically generate a test report containing test results, problem summary, and improvement suggestions.
[0041] In the above step S2, the knowledge graph construction layer includes: A data integration module is used to integrate multiple rule data sources, including at least structured and unstructured data of industry standards, historical configuration parameters, and equipment technical manuals, to form a comprehensive rule and parameter relationship graph. A relationship analysis module is used to check and analyze the compatibility, dependency relationship, conflict rules, and constraint rules between parameters, and to construct a knowledge graph based on the complex relationships between multiple rules and parameters, where each node represents a parameter or rule and the edge represents the relationship between them. A real-time monitoring and updating module is used to continuously monitor the dynamic changes of industry standards, and when an update is detected, a graph traversal mechanism is automatically triggered to directly determine whether there are any parameter configurations in the existing graph that conflict with the new standard through pre-set static conflict detection rules. A conflict prediction module uses neural network technology to automatically predict potential rule conflicts in the configuration path by learning historical conflict data and parameter relationships to identify and alert possible conflict points in advance, thereby optimizing the parameter configuration process and reducing the cost of later debugging.
[0042] In the above step S2, the reinforcement learning decision layer includes: The decision model training module trains the decision model using a reinforcement learning algorithm to learn the optimal parameter configuration strategy under different environmental states. The environmental state modeling module models the environmental state using a hybrid decision mechanism. This module is used to convert the current system state into an input format suitable for reinforcement learning algorithm processing, and to adjust parameters or enable specific rules in the dynamic space according to policy requirements. The action effect evaluation module defines and evaluates the effect of each action after execution, including at least the rationality of parameter configuration, the improvement of system performance, the reduction of error rate, etc., to quantitatively evaluate the effect of reinforcement learning decision. The action legality verification module directly verifies the legality of the action through interaction with the knowledge graph construction layer when the agent receives the current state and generates the action. Actions that are incompatible or violate preset rules are immediately blocked to ensure that the generated parameter configuration meets business logic and industry standards. The reward feedback and model update module receives the reward signal Rt and the new state St+1 from the environment, and updates the policy network and value network based on the reward signal. The parameter configuration generation and packaging module generates the optimal parameter configuration based on the trained decision model, and structures the parameter data into a standard format for sending to the card production system for execution. The real-time feedback and interaction interface is used to feed back the generated parameter configuration to the dynamic interaction interface in real time.
[0043] In the above step S2, the dynamic interaction interface is set as a communication bridge between the knowledge graph construction layer and the reinforcement learning decision layer. The dynamic interaction interface includes: The data and rule transmission unit is used to obtain the rules and data required for parameter configuration from the knowledge graph construction layer, including at least industry standards, historical configuration parameters, device technical specifications, and parameter relationship graph, and transmit these information in a structured format to the reinforcement learning decision layer. The state synchronization unit realizes the synchronous update of the states of the knowledge graph construction layer and the reinforcement learning decision layer through a bidirectional data exchange mechanism. The decision result feedback unit receives the parameter configuration decision results generated by the reinforcement learning decision layer, and feeds back these results to the knowledge graph construction layer for verifying the effectiveness of the decision and further optimizing the rules and parameter relationships in the knowledge graph. At the same time, the construction strategy of the knowledge graph is adjusted according to the feedback results to form a closed-loop optimization mechanism.
[0044] Specifically, in the above step S2, an AI-driven intelligent parameter configuration engine is provided, which is driven by a dual-core of a knowledge graph business rule base and a reinforcement learning optimization model, constructs an intelligent parameter configuration system, realizes automatic decision-making from demand input to optimal parameter output, and realizes priority dynamic adjustment and rule conflict detection between parameters by using a neural network. This technical solution has three layers, the upper layer is a knowledge graph construction layer, the lower layer is a reinforcement learning decision layer, and the middle layer is a dynamic interactive interface, as shown in Figure 3 .
[0045] The knowledge graph construction layer integrates multiple rules, aggregates structured / unstructured data sources such as industry standards, historical configuration parameters, and equipment technical manuals; checks the relationships between parameters, such as compatibility, dependency, conflict rules, and constraint rules between parameters, builds a graph through multiple rules and parameter relationships; and this layer needs to monitor the update of industry standards in real time, directly judges static conflicts through graph traversal, and automatically predicts potential rule conflicts in the configuration path by using a neural network (GNN).
[0046] The reinforcement learning decision layer needs to use a reinforcement learning algorithm (such as Q-learning or DQN) to train a decision model, use a hybrid decision mechanism to model the environment state, including converting the current system state into an input format suitable for reinforcement learning in the state space, adjusting parameters or enabling rules in the dynamic space, and defining the effect of evaluating each action. The reinforcement learning training process is as follows: the agent receives the current state St, the agent receives the current state At, directly checks the legality of the action through the knowledge graph and blocks illegal actions (such as selecting incompatible chip models), the environment feedback reward Rt and the new state St+1, and the policy network and value network are updated simultaneously, as shown in Figure 4 After the reinforcement learning layer generates the parameter configuration, the structured parameter data (such as JSON or XML) is sent to the card production system, the generated parameter configuration is executed, and real-time feedback is fed back to the dynamic interactive interface.
[0047] The dynamic interactive interface needs to contact the knowledge graph construction layer and the reinforcement learning decision layer, one is to obtain rules and data from the knowledge graph layer and pass them to the reinforcement learning layer; the second is state synchronization, to ensure that the states of the two layers are consistent; the third is to feed back the decision results of the reinforcement learning layer to the knowledge graph layer for further optimization.
[0048] In the above step S3, the intelligent script generation engine needs to collect card production results and verification data after each card production cycle, inject these new data into the model training process in real time, and use an incremental learning algorithm (such as Figure 5updating model parameters to generate a dynamic rule knowledge base. For the case of limited data in the card production scenario, small sample learning technology is used to improve the adaptability of the model under a small amount of data.
[0049] After generating the dynamic rule knowledge base, based on the functional rules in the current version of the requirement, the dynamic rule knowledge base drives the cognitive script generator in the card production system to automatically generate card production scripts that meet the current business requirements; wherein the dynamic rule knowledge base is continuously updated and optimized through an incremental learning mechanism based on real-time collection of card production results and verification data, to ensure that the generated scripts adapt to business changes; The system performs functional verification on the generated scripts in a sandbox environment or a simulation test environment and feeds back the verification results to the incremental learning engine in real time; the incremental learning engine adjusts the rules and parameters in the dynamic rule knowledge base according to the feedback results to realize self-optimization and iteration of the script generator; The card production system analyzes the generated scripts for functional points, automatically calls VSCode AI or other code generation tools, and generates corresponding component program code based on script requirements; Integrate the code quality verification tool StarCoder or other equivalent tools in the integrated development environment IDE to perform static and dynamic code quality analysis on the generated component program code, including at least syntax checking, logic error detection, performance evaluation, and security vulnerability scanning, to ensure that the generated code meets the predetermined quality standards and business requirements, such as Figure 6 as shown.
[0050] In the above step S4, the cognitive script generation layer is mainly implemented based on a large language model (such as LLM), combined with the professional knowledge base of card production and dynamic interaction mechanism, to realize end-to-end generation from natural language requirements to executable scripts. First, a large amount of related scripts, industry standard specifications, and API instructions should be extracted from existing card production systems. These data will be used to fine-tune large language models to better adapt to the specific needs of the card production field. The collected raw data is cleaned to remove irrelevant information and noise data, ensuring that the data input into the model is of high quality and high relevance. According to the characteristics of card production scripts, the data is appropriately labeled and converted into a format suitable for model training, such as script or code snippets.
[0051] Select a suitable large language model (such as Claude, ChatGPT, Bloom, Llama, etc.) as the base model, use domain adaptation pre-training (DAPT) on the general LLM (such as LLaMA-2), and use LoRA to efficiently fine-tune the parameters based on industry technical documents. After generating new scripts, extract feature vectors through verification feedback and store them in the version library to record the inheritance and optimization relationship between scripts, facilitating script framework reuse. The core implementation logic is as follows: Figure 7As shown.
[0052] In the above step S5, after the card production system automatically produces the test card, the card test interface is called, and the architecture is as shown in Figure 8 As shown, by constructing a virtual image of the card function, combined with an automated test engine, simulation verification of the full life cycle process is realized, and the test architecture is divided into the following core modules, as shown in Figure 9
[0053] Specifically, the digital twin test verification system comprises: A digital twin model layer for constructing a virtual card model, which is used to simulate the hardware characteristics, communication protocols and application functions of a real IC card; supports dynamic adjustment of model parameters, including at least chip type, radio frequency parameter, encryption algorithm, transaction protocol and card payment logic; at the same time, the model layer can simulate the complete life cycle process of the IC card from issuance to cancellation, and generate virtual transaction data for testing the performance of the card in different scenarios; A sandbox environment layer integrated with an automated test strategy for simulating the operating environment of a contact / non-contact reader; the environment layer automatically executes pre-designed test cases, records test results, and connects the digital twin model layer and the real system to realize bidirectional data transmission; at the same time, it records each operation and abnormal event in the test process in real time; An automated test tool that automatically derives test paths based on the information simulated by the digital twin model layer, calculates the proportion of functional modules covered by test cases, quickly locates problems found in the test process, generates detailed repair suggestions, and automatically generates a test report containing test results, problem summaries and improvement suggestions to support continuous optimization and quality control of the card production process.
[0054] In the above step S2, the steps of the agent interacting with the environment in the reinforcement learning decision-making layer process specifically include: The agent receives the current system state St at each decision-making time t, which is represented as a vector St = [s1, s2,..., s n ], where s i represents the i-th state feature parameter; at the same time, it receives the candidate action At generated based on the current policy, which is represented as a vector At = [a1, a2,..., a m ], where a j represents the j-th action dimension parameter; The agent verifies the legality of the candidate action At by calling the knowledge graph verification interface. The verification logic is based on a pre-constructed parameter compatibility rule library. If the action contains incompatible chip models or violates business constraints, the verification function is represented as: χ(At) ∈ {0,1}, where χ(At)=0 indicates an illegal action, and the action execution is immediately blocked and the strategy is re-planned. After the execution of the legal action, the environment returns the immediate reward Rt and the next state St+1, where the reward value is calculated by a multi-objective weighting function: Rt = w1·R_performance(St,At) + w2·R_safety(St,At) + w3·R_cost(St,At) where R_performance represents the performance improvement reward, which is positively related to the card production efficiency; R_safety represents the safety reward, which is negatively related to the number of parameter conflicts; R_cost represents the cost optimization reward, which is negatively related to the resource consumption; w1, w2, and w3 are weight coefficients, satisfying w1+ w2+ w3= 1; The policy network π(St) outputs an action probability distribution based on the current state, and the value network V(St) evaluates the state value. The update formula is: θ_π ← θ_π + α·▽θ_π logπ(At|St)·(Rt + γ·V(St+1) - V(St)) θ_V ← θ_V + β·▽θ_V (Rt + γ·V(St+1) - V(St)) 2 where θ_π and θ_V are the parameters of the policy network and the value network, respectively; α and β are the learning rates; γ is the discount factor, with a value range of (0,1]; and ▽ represents the gradient operator.
[0055] In the above step S4, the script generation and optimization method based on a multi-modal large language model specifically includes: From the candidate large language model set M = {Claude, ChatGPT, Bloom, Llama,...}, select the optimal base model based on the performance evaluation indicators in the card production field where the evaluation function is defined as:
[0056] where, P sem is the semantic understanding accuracy, calculated by the test set question and answer task; P code is the code generation correctness, measured by the unit test pass rate; Kdomain For domain knowledge coverage, based on knowledge graph question answering accuracy evaluation; α , β , gamma is a weight coefficient, satisfying α + β + gamma =1; Adopting the domain adaptation pre-training DAPT technology, on the basis of general LLM, use the card industry technical document set D ={d1, d2,..., d n} for continuous pre-training, and the optimization goal is to minimize the field language model loss function:
[0057] Where, p θ is the conditional probability distribution when the model parameter is θ; t is the token sequence in the document.
[0058] Using LoRA technology to fine-tune the pre-trained model, decompose the weight matrix into a low-rank matrix: Δ W = AB T Where, A ∈R d × r , B ∈R r × d , r≪d is the low-rank dimension; only update A and B matrix parameters during the fine-tuning process, keep the original model parameters frozen; The newly generated script S n After digital twin test verification, extract its feature vector v n , the feature dimension includes:
[0059] Where, f syntax is the grammatical correctness feature, that is, 0 / 1 encoding; f logic is the logic coverage, calculated by control flow graph node coverage; f perf is the performance indicator, that is, the execution time normalized value; f sec is the security score, based on vulnerability scan results; The feature vector v nThe script metadata is stored in a version library V, and a script inheritance relationship graph G = (S, E) is established, wherein edges e ij ∈ E represent the optimization relationship of the script S i . j The weight is defined as: The denominator is the Euclidean distance of the feature vector, and the script framework reuse recommendation based on semantic similarity is realized.
[0060] In summary, the present application reconstructs the technical paradigm of intelligent IC card production through the deep integration of artificial intelligence, knowledge graph and digital twin technology, not only solves the core pain points of low efficiency, poor quality and slow adaptation in traditional processes, but also provides an extensible technical framework for the intelligent transformation of the industry through knowledge accumulation and ecological open design, which has significant technical value and market prospect.
[0061] The technical features of the above embodiments can be combined arbitrarily, and to make the description concise, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.
[0062] The above-described embodiments are only preferred embodiments of the present application, and cannot be used to limit the scope of protection of the present application, and any non-essential changes and replacements made by those skilled in the art based on the present application shall fall within the scope of protection of the present application.
Claims
1. A smart script generation method based on smart IC card card making, characterized in that, Comprise: Different interfaces in the card production system are called by artificial intelligence agents to realize the whole-process automatic control of parameter configuration, script generation, component program generation, automatic card production and card testing in a modular manner; An intelligent parameter configuration system is constructed by adopting a dual-core driving architecture including a knowledge graph business rule base and a reinforcement learning optimization model, wherein the knowledge graph construction layer is used to integrate industry standards, historical configuration parameters and equipment technical manuals, form a parameter relationship graph, and monitor industry standard updates in real time for static conflict detection; the reinforcement learning decision layer uses a reinforcement learning algorithm to model the environment state, dynamically adjusts parameters or enables rules, and realizes the automatic decision-making process from demand input to optimal parameter output; By using an incremental learning mechanism, card production results and verification data are automatically collected at the end of each card production cycle, and these new data are injected into the model training process in real time, and the model parameters are updated by the incremental learning algorithm to generate a dynamic rule knowledge base; Based on a multi-modal large language model, combined with a professional knowledge base in the card production field and a dynamic interaction mechanism, the large language model is adapted to the specific needs of the card production field through domain adaptation pre-training and parameter fine-tuning technology to generate card production scripts that meet current needs.
2. The method of claim 1, wherein, Also include: A digital twin test verification system is used to construct a virtual image of the card function, simulate the whole life cycle process of the real card, including hardware, protocol and application function, and automatically execute test cases in a sandbox environment to realize simulation verification of the whole life cycle process, and automatically generate a test report containing test results, problem summary and improvement suggestions.
3. The method of claim 1, wherein, The knowledge graph construction layer comprises: A data integration module is used to integrate multiple rule data sources, including at least structured data and unstructured data of industry standards, historical configuration parameters and equipment technical manuals, to form a comprehensive rule and parameter relationship graph; A relationship analysis module is used to check and analyze the compatibility, dependency relationship, conflict rules and constraint rules between parameters, and to construct a knowledge graph based on the complex relationships between multiple rules and parameters, wherein each node represents a parameter or rule, and the edge represents the relationship between them; A real-time monitoring and updating module is used to continuously monitor the dynamic changes of industry standards, and automatically trigger the graph traversal mechanism when an update is detected, directly determine whether there are conflicting parameter configurations in the existing graph with the new standard through the preset static conflict detection rules; A conflict prediction module uses neural network technology to automatically predict potential rule conflicts in the configuration path, and by learning historical conflict data and parameter relationships, it can identify and alert possible conflict points in advance to optimize the parameter configuration process and reduce the cost of later debugging.
4. The method of claim 1, wherein, The reinforcement learning decision layer comprises: A decision model training module uses a reinforcement learning algorithm to train the decision model to learn the optimal parameter configuration strategy under different environment states; An environment state modeling module uses a hybrid decision mechanism to model the environment state, which is used to convert the current system state into an input format suitable for reinforcement learning algorithm processing, and adjust parameters or enable specific rules in the dynamic space according to the policy requirements; An action effect evaluation module defines and evaluates the effect of each action after execution, including at least the rationality of parameter configuration, the improvement of system performance, the reduction of error rate, and other indicators to quantitatively evaluate the effect of reinforcement learning decision; An action legality verification module directly verifies the legality of the action through interaction with the knowledge graph construction layer when the agent receives the current state and generates the action, and immediately blocks the action that is incompatible or violates the preset rules, to ensure that the generated parameter configuration meets the business logic and industry standards; A reward feedback and model updating module receives the reward signal Rt and the new state St+1 from the environment feedback, and updates the policy network and the value network based on the reward signal; A parameter configuration generation and packaging module generates the optimal parameter configuration based on the trained decision model, and structures and packages the parameter data into a standard format for sending to the card production system for execution; A real-time feedback and interaction interface is used to feed back the generated parameter configuration to the dynamic interaction interface in real time.
5. The method of claim 4, wherein, A dynamic interaction interface is set as a communication bridge between the knowledge graph construction layer and the reinforcement learning decision layer, which includes: A data and rule delivery unit is used to obtain the rules and data required for parameter configuration from the knowledge graph construction layer, including at least industry standards, historical configuration parameters, device technical specifications, and parameter relationship graphs, and deliver these information in a structured format to the reinforcement learning decision layer; A state synchronization unit realizes the synchronous updating of the states of the knowledge graph construction layer and the reinforcement learning decision layer through a bidirectional data exchange mechanism; A decision result feedback unit receives the parameter configuration decision results generated by the reinforcement learning decision layer, and feeds back these results to the knowledge graph construction layer for verifying the effectiveness of the decision and further optimizing the rules and parameter relationships in the knowledge graph; at the same time, the construction strategy of the knowledge graph is adjusted according to the feedback results, forming a closed-loop optimization mechanism.
6. The method of claim 1, wherein: After generating the dynamic rule knowledge base, based on the functional rules in the current version of the demand, the dynamic rule knowledge base is used to drive the cognitive script generator in the card production system to automatically generate card production scripts that meet the current business demand; wherein the dynamic rule knowledge base is continuously updated and optimized through an incremental learning mechanism based on real-time collected card production results and verification data, to ensure that the generated scripts adapt to business changes; The system performs functional verification of the generated scripts in a sandbox environment or a simulation test environment, and feeds back the verification results to the incremental learning engine in real time; the incremental learning engine adjusts the rules and parameters in the dynamic rule knowledge base according to the feedback results, to realize self-optimization and iteration of the script generator; The card production system performs functional point analysis on the generated scripts, automatically calls VSCode AI or other code generation tools, and generates corresponding component program code according to the script requirements. Integrate the code quality verification tool StarCoder or other equivalent tools in the integrated development environment IDE, and perform static and dynamic code quality analysis on the generated component program code, including at least syntax checking, logic error detection, performance evaluation and security vulnerability scanning, to ensure that the generated code meets the predetermined quality standards and business requirements.
7. The method of claim 2, wherein, The digital twin test verification system comprises: A digital twin model layer for constructing a virtual card model, which is used to simulate the hardware characteristics, communication protocols and application functions of a real IC card; supports dynamic adjustment of model parameters, including at least chip type, radio frequency parameter, encryption algorithm, transaction protocol and card payment logic; at the same time, the model layer can simulate the complete life cycle process of the IC card from issuance to cancellation, and generate virtual transaction data for testing the performance of the card in different scenarios; A sandbox environment layer integrated with an automated testing strategy, used to simulate the operating environment of a contact / non-contact reader; the environment layer automatically executes pre-designed test cases, records test results, and connects the digital twin model layer with the real system to realize bidirectional data transmission; at the same time, it records each operation and abnormal event in the testing process in real time; An automated testing tool that automatically derives test paths based on the information simulated by the digital twin model layer, and calculates the proportion of functional modules covered by the test cases; quickly locates problems found during testing, generates detailed repair suggestions; and automatically generates a test report containing test results, problem summaries and improvement suggestions to support continuous optimization and quality control of the card production process.
8. The method of claim 4, wherein: The step of the agent interacting with the environment in the reinforcement learning decision-making layer process specifically includes: The agent receives the current system state St at each decision time t, which is represented as a vector St = [s1, s2,..., s n ], where s i represents the i-th state feature parameter; and receives the candidate action At generated based on the current policy, which is represented as a vector At = [a1, a2,..., a m ], where a j represents the j-th action dimension parameter. The agent verifies the legality of the candidate action At by calling the knowledge graph verification interface, and the verification logic is based on a pre-constructed parameter compatibility rule library. If the action contains incompatible chip models or violates business constraints, the verification function is represented as: χ(At) ∈ {0,1}, where χ(At)=0 represents an illegal action, and the action execution is immediately blocked and a policy re-planning is triggered; After the execution of the legal action, the environment returns the immediate reward Rt and the next state St+1, wherein the reward value is calculated by a multi-objective weighting function: Rt = w1·R_performance(St,At) + w2·R_safety(St,At) + w3·R_cost(St,At) where R_performance represents a performance improvement reward, which is positively correlated with card production efficiency; R_safety represents a safety reward, which is negatively correlated with the number of parameter conflicts; R_cost represents a cost optimization reward, which is negatively correlated with resource consumption; w1, w2, w3 are weight coefficients, satisfying w1+ w2 + w3= 1; The policy network π(St) outputs an action probability distribution based on the current state, and the value network V(St) evaluates the state value, and the update formula is: θ π ← θ π + α · ∇ θ π log π (At | St) · (Rt + γ · V (St+1) - V (St)) θ_V <— θ_V + β-∇θ_V (Rt + γ-V(St+1) - V(St)) 2 Wherein, θ π and θ V are parameters of the policy network and the value network respectively; Alpha and beta are learning rates; Gamma is a discount factor, the value range is (0, 1]; The gradient operator is represented by ∇.
9. The method according to any one of claims 1 to 8, characterized in that, The script generation and optimization method based on the multi-modal large language model specifically comprises the steps of: From a candidate large language model set M = {Claude, ChatGPT, Bloom, Llama,...}, the optimal base model is selected based on the performance evaluation index of the card making field where the evaluation function is defined as: wherein, P sem For semantic understanding accuracy, calculate through test set question and answer task; P code For code generation accuracy, measure through unit test pass rate; K domain For domain knowledge coverage, evaluate based on knowledge graph question and answer accuracy; α , β , Gamma is a weight coefficient, satisfying α + β + Gamma =1; Using the domain adaptation pre-training DAPT technology, on the basis of the general LLM, the card manufacturing industry technical document set D = {d1, d2,..., d n} is continuously pre-trained, and the optimization goal is to minimize the domain language model loss function: wherein, p θ is the conditional probability distribution for model parameters t is the sequence of tokens in the document.
10. The method of claim 9, wherein: The pre-training model is fine-tuned by using the LoRA technology, and the weight matrix is decomposed into a low-rank matrix: Δ W = AB T wherein, A ∈R d × r , B ∈R r × d , r << d is the low-rank dimension; only update A and B matrix parameters in the fine-tuning process, keep the original model parameters frozen; Newly generated script S n After the digital twin test is verified, the feature vector thereof is extracted v n The feature dimension includes: wherein, f syntax is a syntactic correctness feature, i.e. 0 / 1 encoding; f logic is a logical coverage, computed by control flow graph node coverage; f perf is a performance indicator, i.e. execution time normalized value; f sec is a security score, based on vulnerability scan results; The feature vector v n The script metadata is stored in the version library V, and a script inheritance relationship graph G = (S, E) is established, wherein the edge e ij ∈ E represents the optimization relationship of the script S i to S j , and the weight is defined as: Wherein, the denominator is the Euclidean distance of the feature vector, and the script framework reuse recommendation based on semantic similarity is realized.
Citation Information
Cited By
A method and system for generating a power plant gateway setting scheme
CN122334045A