A method, system, and electronic equipment for intelligent coding generation of railway master data
By combining railway knowledge graphs and named entity recognition models with a dedicated locking mechanism, intelligent and efficient concurrent processing of railway master data coding has been achieved, solving the problems of coding accuracy and performance, and supporting the digital transformation of the railway industry.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-07
- Publication Date
- 2026-04-03
AI Technical Summary
The existing railway master data coding system is insufficient in terms of accuracy and concurrency performance, and cannot meet the high concurrency and high performance requirements of the railway industry. In addition, the low flexibility of coding rule configuration leads to the problem of data silos.
Semantic analysis is performed using railway domain knowledge graphs and named entity recognition models, combined with a dedicated lock concurrency control mechanism to achieve intelligent matching and parallel processing of coding rules, supporting flexible configuration of multiple code segment types.
It improved the accuracy of coding and system performance, solved the concurrency performance bottleneck, ensured the uniqueness and standardization of coding, eliminated the problem of data silos, and supported the data foundation for the digital transformation of the railway industry.
Smart Images

Figure CN121457442B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data processing, and specifically relates to an intelligent coding generation method, system and electronic equipment for railway master data. Background Technology
[0002] With the deepening of digital transformation in the railway industry, building a unified and standardized data infrastructure has become an industry consensus. As the core of enterprise-level data architecture, the data infrastructure aims to achieve standardized, centralized, and asset-based management of data resources across the entire railway network through master data management. Against this backdrop, unified coding of core business objects such as railway equipment and facilities has become a crucial foundational task for building the railway data infrastructure and breaking down data barriers between various business systems.
[0003] However, in the existing construction practices of the data infrastructure, the master data coding stage faces severe challenges. Firstly, the railway industry has a wide variety of equipment with high specialization, and equipment naming follows strict industry standards. For example, the railway equipment classification and code specifications contain numerous professional abbreviations, model codes, and hierarchical relationships. Existing general coding generation technologies lack railway-specific knowledge embedding and cannot accurately understand the semantic connotations of specialized equipment names such as the CRH380A EMU bogie, leading to inaccurate coding rule matching and failing to meet the stringent requirements of the data infrastructure for coding accuracy and standardization.
[0004] Secondly, the data infrastructure needs to serve all business systems across the entire network, facing high-concurrency coding requests in scenarios such as centralized equipment data entry and batch maintenance. The global lock concurrency control strategy used in traditional coding generation mechanisms severely restricts the concurrent processing capabilities of the data infrastructure. Coding requests from different businesses and with different rules queue up and become congested under the global lock mechanism, failing to fully leverage the distributed architecture advantages of the data infrastructure and becoming a bottleneck for system performance.
[0005] Furthermore, the existing coding system lacks sufficient synergy with the data base, and the coding rule configuration is inflexible, making it difficult to adapt to the dynamic adjustment needs of the coding system required by the rapid development of railway operations. This often results in data silos due to coding inconsistencies when the data base collects and integrates data from various source systems, affecting the realization of the data base's expected value.
[0006] Therefore, there is an urgent need in this field to develop an intelligent coding generation method that can deeply integrate railway knowledge, intelligently adapt coding rules, and effectively support the high concurrency and high performance requirements of the data base, so as to solidify the data foundation for the digital transformation of the railway industry. Summary of the Invention
[0007] To address the aforementioned problems in the prior art, namely the low coding efficiency, high error rate, and poor concurrency performance of railway master data, this invention provides an intelligent coding generation method, system, and electronic device for railway master data.
[0008] In a first aspect, this invention proposes an intelligent coding generation method for railway master data, comprising the following steps:
[0009] Responding to a master data encoding request containing information about the object to be encoded;
[0010] Based on a pre-set railway domain knowledge graph and a named entity recognition model trained on railway domain corpus, semantic analysis is performed on the information of the object to be encoded in order to extract core entities and their associated attributes.
[0011] Based on the core entity and its associated attributes, an encoding rule suitable for the object to be encoded is automatically matched or combined from a predefined encoding rule library;
[0012] Based on the unique identifier of the encoding rule, a dedicated lock corresponding to the encoding rule is obtained, and after obtaining the dedicated lock, the encoding generation operation is performed. Among them, multiple encoding requests with the same unique identifier of the encoding rule are serialized through the dedicated lock, while multiple encoding requests with different unique identifiers of the encoding rule are parallelized.
[0013] Based on the encoding rules and the result of the encoding generation operation, a unique object code is generated, and the exclusive lock is released.
[0014] Furthermore, before the step of automatically matching or combining an encoding rule, a step of configuring the encoding rule base is included, the configuration step including:
[0015] For code segments of fixed code type, configure its code segment name, fixed code value, code segment prefix and suffix, and associate the fixed code value with the railway industry standard code;
[0016] For sequential code segments, configure their bit length, step size, starting value, and padding value, and additionally configure railway equipment category attributes so that sequential codes with the same code segment paradigm are grouped and counted independently according to equipment category;
[0017] For date code type segments, configure them to support railway year or maintenance cycle formats and associate them with equipment categories;
[0018] For random code types, their generation is associated with device category and key attributes.
[0019] Furthermore, the semantic analysis based on the preset railway domain knowledge graph and named entity recognition model includes:
[0020] Using the named entity recognition model, entities are identified from the information of the object to be encoded, and the entities include at least railway-specific abbreviations and equipment models;
[0021] In the railway domain knowledge graph, query the hierarchical relationships or functional attributes between the core entities;
[0022] Based on the queried hierarchical relationships or functional attributes, the classification and characteristics of the object to be encoded are determined for matching the encoding rules.
[0023] Furthermore, the mechanism for obtaining a dedicated lock based on the unique identifier of the encoding rule includes:
[0024] Assign a unique identifier to each encoding rule;
[0025] In distributed shared memory, the mapping relationship between the unique identifier and the dedicated lock resource is maintained;
[0026] When an encoding request arrives, the corresponding dedicated lock resource is located and acquired in the distributed shared memory based on the unique identifier of the encoding rule corresponding to the request.
[0027] Furthermore, when the encoding rule includes a serial number, the encoding generation operation includes:
[0028] After acquiring the exclusive lock, read the current maximum flow value associated with the unique identifier of the encoding rule;
[0029] Based on the preset step size and bit length, a new serial number is calculated on the basis of the current maximum serial number value;
[0030] The new maximum serial number corresponding to the new serial number will be persistently updated, and the dedicated lock will be released.
[0031] Furthermore, when the encoding rule includes a random code, the encoding generation operation includes:
[0032] Using a dedicated lock mechanism, an initial true random seed is generated for each unique identifier of the encoding rule, and this seed is stored in the database as the maximum seed value under that rule.
[0033] When performing random code generation, after acquiring the exclusive lock, the maximum seed value is read and incremented as a new seed value for the pseudo-random number generation algorithm to calculate a new random code.
[0034] Furthermore, before releasing the dedicated lock, the new seed value is updated back to the database as the new maximum seed value.
[0035] Furthermore, the named entity recognition model is obtained through the following steps:
[0036] Using a pre-trained language model as the base model; and
[0037] The basic model was fine-tuned using a railway-related corpus containing railway equipment names, technical parameters, and maintenance records.
[0038] Furthermore, when the step of automatically matching or combining an encoding rule from a predefined encoding rule library based on the core entity and its associated attributes fails, the method further includes the following steps:
[0039] The core entity and its associated attributes that cause a matching failure are stored as an unmatched pattern sample in the sample pool.
[0040] Clustering is performed on multiple unmatched pattern samples in the sample pool to form at least one sample cluster containing one or more semantically similar samples, and it is determined whether the number of samples in the sample cluster meets a preset frequency threshold.
[0041] In response to the number of samples within the sample cluster meeting the preset frequency threshold, the common entity and attribute features of the samples within the sample cluster are automatically extracted, and combined with the hierarchical relationship in the railway domain knowledge graph, a new rule creation suggestion is generated by matching from a preset meta-rule template library.
[0042] Furthermore, upon receiving confirmation from the data administrator regarding the creation of the new rule to activate a new rule, samples within the sample cluster that meet the frequency threshold are used as new training data for incremental training of the named entity recognition model.
[0043] In a second aspect, the present invention proposes an intelligent coding generation system for railway master data, used to implement an intelligent coding generation method for railway master data. The system includes:
[0044] The request acquisition module is configured to respond to master data encoding requests containing information about the object to be encoded.
[0045] The semantic analysis module is configured to perform semantic analysis on the information of the object to be encoded based on a preset railway domain knowledge graph and a named entity recognition model trained on railway domain corpus, so as to extract core entities and their associated attributes.
[0046] The encoding rule acquisition module is configured to automatically match or combine an encoding rule suitable for the object to be encoded from a predefined encoding rule library based on the core entity and its associated attributes.
[0047] The encoding module is configured to acquire a dedicated lock corresponding to the encoding rule based on the unique identifier of the encoding rule, and to perform an encoding generation operation after acquiring the dedicated lock. Multiple encoding requests with the same unique identifier of the encoding rule are serialized through the dedicated lock, while multiple encoding requests with different unique identifiers of the encoding rule are parallelized.
[0048] Based on the encoding rules and the result of the encoding generation operation, a unique object code is generated, and the exclusive lock is released.
[0049] In a third aspect, the present invention provides an electronic device comprising:
[0050] At least one processor;
[0051] and a memory communicatively connected to at least one of the processors;
[0052] The memory stores instructions that can be executed by the processor to implement an intelligent coding generation method for railway master data.
[0053] The beneficial effects of this invention are:
[0054] By introducing a railway equipment knowledge graph and a dedicated named entity recognition model, the system can deeply understand railway-related terminology, equipment models, and hierarchical relationships. This effectively overcomes the limitations of general coding systems in handling industry-specific semantics, achieving intelligent and accurate matching between coding rules and equipment attributes. It ensures from the source that the generated codes conform to industry standards and business logic, significantly improving the quality of master data.
[0055] A dedicated lock concurrency control mechanism based on encoding rule IDs is adopted, replacing the traditional global lock. This mechanism allows requests with different encoding rules to be executed in parallel in their respective independent processing queues, completely solving the system performance bottleneck problem caused by contention for a single lock resource. This enables the system to efficiently handle massive concurrent requests, fully meeting the high throughput requirements of the data infrastructure.
[0056] In sequential code generation, atomic operations coordinated with a dedicated lock and the maximum sequential position in the database ensure that sequential codes are continuously increasing and non-repeating under the same rule. In random code generation, by maintaining an independent and ordered increasing true random seed for each rule, the risk of random code conflicts is fundamentally avoided. These two mechanisms together provide reliable technical support for the unique identification management of the data base.
[0057] It supports free combination and flexible configuration of multiple code segment types, enabling encoding rules to quickly adapt to the encoding needs of different business scenarios and various railway equipment. This high degree of configurability allows the invention to adapt well to the development and changes in railway operations, meeting the data foundation's requirements for dynamic expansion and flexible integration.
[0058] By providing accurate, unique, and standardized device codes, the problem of data silos caused by inconsistent coding is eliminated for the data foundation. High-quality master data coding, as a unified standard identifier, lays a solid foundation for subsequent data integration, sharing, analysis, and application, strongly supporting the in-depth digital transformation of the railway industry. Attached Figure Description
[0059] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0060] Figure 1 This is a flowchart illustrating an intelligent coding method for generating railway master data according to the present invention.
[0061] Figure 2 This is a flowchart illustrating the encoding generation operation when the encoding rule includes a serial number in an intelligent encoding generation method for railway master data according to the present invention.
[0062] Figure 3 This is a flowchart illustrating the encoding generation operation in an intelligent encoding generation method for railway master data according to the present invention, when the encoding rule includes a random code. Detailed Implementation
[0063] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the invention. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.
[0064] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0065] The first embodiment of the present invention proposes an intelligent coding generation method for railway master data, comprising the following steps:
[0066] Step S10, responding to a master data encoding request containing information about the object to be encoded;
[0067] Step S20: Based on a preset railway domain knowledge graph and a named entity recognition model trained on railway domain corpus, perform semantic analysis on the information of the object to be encoded in order to extract core entities and their associated attributes.
[0068] Step S30: Based on the core entity and its associated attributes, automatically match or combine an encoding rule suitable for the object to be encoded from a predefined encoding rule library;
[0069] Step S40: Based on the unique identifier of the encoding rule, obtain a dedicated lock corresponding to the encoding rule, and after obtaining the dedicated lock, perform the encoding generation operation. Multiple encoding requests with the same unique identifier of the encoding rule are serialized through the dedicated lock, while multiple encoding requests with different unique identifiers of the encoding rule are parallelized.
[0070] Step S50: Generate a unique object code based on the encoding rules and the result of the encoding generation operation, and release the exclusive lock.
[0071] To more clearly explain the intelligent coding generation method for railway master data according to the present invention, the following will be combined with... Figure 1 The steps in the embodiments of the present invention are described in detail below:
[0072] The detailed process of this embodiment is as follows: Figure 1As shown, when the railway data base platform receives a master data encoding request, for example, when a user creates a new master data record in the asset management module with the description "CRH380A EMU-01 Bogie", the system initiates the encoding generation process. First, the system uses a specially constructed natural language processing module to perform deep semantic analysis on "CRH380A EMU-01 Bogie", identifying key business entities and their attributes, such as train model and component name. Then, based on the analysis results, the system intelligently searches for and matches the most suitable encoding rule in a pre-configured encoding rule library, such as a rule defined as "train model code + component classification code + serial number". To cope with encoding requests faced by the data base in high-concurrency scenarios (such as centralized equipment entry and batch maintenance), this method designs a unique concurrency control mechanism. The system assigns a unique identifier to each encoding rule (e.g., "bogie encoding rule") and acquires a dedicated lock based on that identifier. This means that all requests for coding "bogies" queue up and wait for the same lock, ensuring that the generation of serial numbers is orderly and unique. Meanwhile, a request for coding "bolts" acquires its own dedicated lock for its corresponding "bolt coding rule," and the two are processed in parallel without interference. After successfully acquiring the lock, the system executes the specific coding generation algorithm, such as generating a new serial number. Finally, the code segments are combined into the final unique code "CRH380A-ZJ-0101," and the lock is immediately released so that the next request in the queue can continue. This method, through intelligent semantic analysis and refined concurrency control, fundamentally solves the problems of low efficiency, error susceptibility, and poor concurrency performance of traditional coding methods, significantly improving the automation level, accuracy, and system processing capacity of railway master data coding.
[0073] Step S20: Based on a preset railway domain knowledge graph and a named entity recognition model trained on railway domain corpus, perform semantic analysis on the information of the object to be encoded in order to extract core entities and their associated attributes.
[0074] In this embodiment, the semantic analysis based on a preset railway domain knowledge graph and named entity recognition model includes:
[0075] Using the named entity recognition model, entities are identified from the information of the object to be encoded, and the entities include at least railway-specific abbreviations and equipment models;
[0076] In the railway domain knowledge graph, query the hierarchical relationships or functional attributes between the core entities;
[0077] Based on the queried hierarchical relationships or functional attributes, the classification and characteristics of the object to be encoded are determined for matching the encoding rules. This semantic analysis is the core of this method's intelligent implementation.
[0078] First, the system uses a Named Entity Recognition (NER) model finely tuned with a railway-related corpus to process the input object information to be encoded. When receiving "CRH380A EMU-01 Bogie", the NER model can accurately decompose it into multiple core entities, such as the railway-specific abbreviation "CRH", the equipment model "380A", the equipment name "EMU", and the component name "Bogie", instead of incorrectly segmenting "CRH380A" as a general model. After extracting these core entities, the system uses them as keywords to query a pre-built railway-related knowledge graph.
[0079] This knowledge graph was constructed by integrating authoritative industry standards such as the "Classification and Code of Railway Equipment" and the "Naming Specification for Railway Signal Equipment," along with a large amount of business data. Internally, it stores the complex relationships between entities in a graph structure. For example, the system can find in the graph that "bogie" is a "component" (hierarchical relationship) of "EMU," and that the functional attribute of "bogie" is defined as "critical spare part." Simultaneously, the graph also records that "CRH380A" is a specific model code under the "CRH" series. By integrating this information obtained from the NER model and the knowledge graph, the system ultimately forms a comprehensive and accurate profile of "CRH380A EMU-01 Bogie."
[0080] This is a bogie belonging to the CRH380A model and classified as a critical spare part. This precise profile is the direct basis for the subsequent automatic matching of the coding rule of "model code + component classification code + serial number". This deep semantic understanding capability ensures that the matching of coding rules no longer relies on rigid templates or manual judgment, but is based on a precise grasp of the true meaning of the business object, which greatly improves the accuracy and standardization of coding and guarantees the data quality of the data base.
[0081] In this embodiment, the named entity recognition model is trained through the following steps: using a pre-trained language model as the base model; and fine-tuning the base model using a railway domain corpus containing railway equipment names, technical parameters, and maintenance records.
[0082] To achieve high-precision recognition of railway terminology, this method employs transfer learning to construct a named entity recognition model. In its implementation, a pre-trained language model, such as BERT, is chosen as the starting point. Models like BERT, through pre-training on massive amounts of general text corpora, have learned rich linguistic structures and semantic knowledge, possessing strong generalization capabilities. However, directly using the general BERT model to process railway-related text is not ideal because it lacks understanding of industry-specific terminology. Therefore, fine-tuning of this basic model is necessary. This requires collecting and organizing a large-scale railway-related professional corpus, which can include official names, technical manuals, operating procedures, historical maintenance records, fault reports, etc., for various railway equipment. Then, using this labeled data containing a large amount of proprietary abbreviations and model numbers such as "CRH," "ZPW," "380A," and "2000A," supervised learning training is performed on the BERT basic model. During this fine-tuning process, the model's parameters are adjusted to gradually adapt to the language style and professional vocabulary of the railway field. The final trained model not only retains the general language understanding capabilities of the basic model, but more importantly, it has learned railway industry jargon through deep learning. It can accurately identify "CRH380A" as an indivisible entity, rather than incorrectly segmenting it into "CRH" and "380A". This domain-adaptive training method is the technological cornerstone for achieving high-precision semantic analysis and subsequent accurate coding rule matching, ensuring that this method can effectively handle the highly specialized and structured data characteristics of the railway industry.
[0083] Between step S20 and step S30, there is also a step of configuring the encoding rule base, which includes:
[0084] For code segments of fixed code type, configure its code segment name, fixed code value, code segment prefix and suffix, and associate the fixed code value with the railway industry standard code;
[0085] For sequential code segments, configure their bit length, step size, starting value, and padding value, and additionally configure railway equipment category attributes so that sequential codes with the same code segment paradigm are grouped and counted independently according to equipment category;
[0086] For date code type segments, configure them to support railway year or maintenance cycle formats and associate them with equipment categories;
[0087] For random code segments, their generation is associated with equipment category and key attributes. To achieve intelligent matching of the encoding rules in the aforementioned steps, the system must pre-establish a highly flexible encoding rule library that is deeply aligned with railway operations.
[0088] This configuration process is fundamental to the successful implementation of the method. During configuration, administrators can freely combine different types of code segments to create a complete coding rule. For example, for fixed codes, an administrator can create a code segment named "vehicle type code," set its fixed value to "CRH380A," and associate it with the official code in the "Railway Equipment Classification and Codes" to ensure coding standardization. For sequential codes, in addition to configuring conventional attributes such as a bit length of 4, a step size of 1, a starting value of 1, and padding with 0s for insufficient bits, this method introduces a "Railway Equipment Category" attribute. For example, for the same 6-digit sequential code, independent counters can be created for the three categories: "Locomotive," "Signal Equipment," and "Track Equipment." In this way, the sequential code for locomotives starts increasing from 000001, and does not interfere with the sequential code for signal equipment, avoiding conflicts and confusion in coding resources across different business areas.
[0089] For date codes, the system supports configuring special railway industry formats, such as "railway year" which only contains the year and month, or date formats associated with specific maintenance cycles, to meet the special needs of asset management and maintenance work.
[0090] The system has also optimized the random codes to prevent them from being meaningless random characters. By associating their generation rules with equipment categories and key attributes—for example, a random code generated for a specific type of sensor might contain specific characters representing its function or installation location—it becomes a "railway equipment-specific random code." This highly configurable and industry-specific rule base design provides strong flexibility and business adaptability for subsequent intelligent matching and code generation, ensuring that the generated codes are not only unique and efficient but also fully compliant with the complex and sophisticated management requirements of the railway industry.
[0091] To fully demonstrate the configuration capabilities, let's take another example of a random code. Suppose we want to create a code for a "signal system sensor," in the form of "SEN-XT-XXXXXXXX," where the last 8 bits are random. The administrator would create a new rule containing a fixed code segment "SEN-XT-" and a random code segment. When configuring the random code segment, in addition to setting the "bit length" to 8, the administrator would also associate it with "Device Category: Signal Sensor" and "Key Attribute: Model XT." This association ensures that the system comprehensively considers these business attributes when generating a random seed, thereby generating a unique and independent random number sequence for this type of sensor, guaranteeing its uniqueness.
[0092] Step S30: Based on the core entity and its associated attributes, automatically match or combine an encoding rule suitable for the object to be encoded from a predefined encoding rule library;
[0093] In step S30, based on the core entities extracted from the master data fields and their associated attributes obtained from the railway equipment knowledge graph, the matching and combination process of coding rules is initiated. The system performs multi-dimensional retrieval and matching in a predefined coding rule library based on the equipment category, model affiliation, and functional characteristics corresponding to the core entities. The coding rule library contains various pre-defined basic rule templates, which are deeply bound to equipment classifications, component levels, and business scenarios in railway industry standards.
[0094] During the matching process, the system first determines the main structural framework of the code based on the core classification of the equipment. For example, for critical components such as EMU bogies, the coding framework typically needs to include the model identifier and the component classification identifier. Subsequently, the system combines the specific attribute details retrieved, such as the specific EMU model CRH380A to which the bogie belongs, and selects the corresponding fixed code value from the rule base to fill in the corresponding position of the framework.
[0095] For dynamically generated components, such as sequence identifiers, the system intelligently selects and configures the corresponding code segment type based on the device's management granularity and business requirements. For example, for components requiring unique sequence identifiers, the system automatically matches sequential code segments and associates them with a dedicated sequence generator under that specific device category and model combination. The entire matching and combination process is based on deep semantic understanding, ensuring that the final generated encoding rules not only conform to specifications in structure but also accurately reflect the device's business nature and management needs, thereby effectively avoiding mismatch issues of general encoding rules in complex railway scenarios.
[0096] Suppose the system receives an object to be encoded, whose main data field information is CRH380A EMU-01 bogie.
[0097] First, two core entities were extracted using a railway-specific named entity recognition model: the CRH380A EMU and the bogie. The associated attributes of these entities were then queried within the railway equipment knowledge graph.
[0098] The CRH380A type EMU is identified as an EMU category, with the associated model code CRH380A. The bogie is identified as a key component, belonging to an important part of the EMU, with the component classification code BOGIE.
[0099] Based on these core entities and associated attributes, the system automatically matches and combines applicable coding rules from the coding rule base: selects the coding framework of vehicle model code + component classification code + serial number, matches the fixed code CRH380A for the vehicle model code segment, matches the fixed code BOGIE for the component classification code segment, and configures the serial number segment to be 3 digits long with a starting value of 001, and generates it independently according to the equipment category EMU-Bogie.
[0100] The final generated encoding rule is: CRH380A+BOGIE+[serial code]. When the system generates an encoding for this type of bogie for the first time, it will generate the encoding "CRH380ABOGIE001".
[0101] Step S40: Based on the unique identifier of the encoding rule, obtain a dedicated lock corresponding to the encoding rule, and after obtaining the dedicated lock, perform the encoding generation operation. Multiple encoding requests with the same unique identifier of the encoding rule are serialized through the dedicated lock, while multiple encoding requests with different unique identifiers of the encoding rule are parallelized.
[0102] The mechanism for obtaining a private lock based on a unique identifier according to the encoding rule includes:
[0103] Assign a unique identifier to each encoding rule; in the distributed shared memory, maintain the mapping relationship between the unique identifier and the dedicated lock resource;
[0104] When an encoding request arrives, the corresponding dedicated lock resource is located and acquired in the distributed shared memory based on the unique identifier of the encoding rule corresponding to the request.
[0105] To ensure the efficiency and uniqueness of code generation in high-concurrency environments, this method abandons the traditional global lock and designs a dedicated lock mechanism. During initialization or when creating a new encoding rule, the system assigns a globally unique identifier (ID) to each rule; for example, the ID for the "bolt encoding rule" is "RULE_01," and the ID for the "locomotive encoding rule" is "RULE_02." Simultaneously, the system utilizes a distributed shared memory system to maintain a lock resource pool. When an encoding request, such as a request to generate an code for a bolt, matches "RULE_01" through semantic analysis, it does not compete for a global lock. Instead, it attempts to acquire a specific lock named "LOCK_RULE_01" in Redis based on the ID "RULE_01." If hundreds or thousands of bolt encoding requests arrive simultaneously, they will all compete for the same "LOCK_RULE_01" lock, forming a processing queue. This ensures that the bolt code generation process is serial and the serial number is not duplicated.
[0106] Meanwhile, if a request for locomotive coding arrives and matches the "RULE_02" rule, it will attempt to acquire the completely independent lock "LOCK_RULE_02". Since "LOCK_RULE_01" and "LOCK_RULE_02" are two different lock resources, the bolt coding queue and the locomotive coding request can be processed in complete parallelism without affecting each other. This mechanism narrows the scope of concurrent conflicts from the entire system to requests with the same coding rules, greatly reducing lock contention and avoiding the "queue congestion" phenomenon where different business coding requests block each other. This significantly improves the throughput and response speed of the entire data infrastructure in high-concurrency scenarios.
[0107] See Figure 2 When the encoding rule includes a serial number, the encoding generation operation includes:
[0108] After acquiring the exclusive lock, read the current maximum flow value associated with the unique identifier of the encoding rule;
[0109] Based on the preset step size and bit length, a new serial number is calculated based on the current maximum serial number; the new maximum serial number corresponding to the new serial number is persistently updated, and the dedicated lock is released.
[0110] After a thread successfully acquires the lock (e.g., "LOCK_RULE_01") corresponding to its encoding rule ID (e.g., "RULE_01"), it enters an atomic operation area. Within this area, it first connects to the database, queries a table specifically for recording serial number status, and reads the current maximum serial number associated with "RULE_01," let's say 100. Next, based on the preset configuration of "RULE_01" (e.g., step size 1, bit length 4), the thread calculates a new serial number in memory. The calculation involves adding the step size 1 to the current maximum value of 100, resulting in 101. Then, according to the bit length requirement of 4, 101 is formatted by padding with leading zeros, resulting in the string "0101". After generating the new serial number, the thread immediately writes the new maximum serial number of 101 back to the database, updating the record corresponding to "RULE_01".
[0111] Only after the database update is successful and persisted will the thread release the "LOCK_RULE_01" lock it holds. At this point, the next thread waiting for the lock in the queue can acquire it and repeat the process. The maximum serial number it reads will be 101, thus generating 102. Because the entire "read-modify-write" process is protected by a dedicated lock, it ensures that only one thread can operate on the serial number counter according to specific rules at any given time. This fundamentally eliminates the problem of duplicate encoding that may occur in a concurrent environment, guaranteeing the strict uniqueness and continuity of the serial number.
[0112] See Figure 3 When the encoding rule includes a random code, the encoding generation operation includes:
[0113] Using a dedicated lock mechanism, an initial true random seed is generated for each unique identifier of the encoding rule, and this seed is stored in the database as the maximum seed value under that rule.
[0114] When performing random code generation, after acquiring the exclusive lock, the maximum seed value is read and incremented as a new seed value for the pseudo-random number generation algorithm to calculate a new random code.
[0115] Furthermore, before releasing the dedicated lock, the new seed value is updated back to the database as the new maximum seed value.
[0116] This method optimizes the generation of random codes to achieve absolute uniqueness. For each encoding rule containing a random code (e.g., ID "RULE_03"), the system triggers an initialization process using a dedicated lock mechanism upon its first invocation. During this process, the system generates an initial true random seed, for example, by combining the current high-precision system timestamp with the hash value of the rule ID "RULE_03," ensuring the initial randomness of the seed. This initial seed is then stored in the database as the "maximum seed value" for "RULE_03." When a subsequent encoding request needs to generate a random code for "RULE_03," the execution thread first acquires the dedicated lock "LOCK_RULE_03." Then, it reads the "maximum seed value" of the current record from the database and increments it by 1 to obtain a new, unique seed value. The thread uses this new seed value as input and feeds it into a deterministic pseudo-random number generation algorithm (e.g., a linear congruential algorithm) to calculate a random code that meets the requirements such as the configured bit length. Due to the characteristics of pseudo-random number algorithms, different seeds will generate different random numbers. After generating the random code, the thread updates the database with the new seed value, replacing the old "maximum seed value", and then releases the lock "LOCK_RULE_03".
[0117] In this way, the problem of generating random codes is transformed into a strictly increasing seed generation problem protected by a dedicated lock. Because the seed is unique and increasing, the generated pseudo-random codes will never be repeated under the same encoding rules, completely solving the collision risk that may exist in traditional random code generation algorithms in concurrent environments and ensuring the uniqueness of the encoding.
[0118] Step S50: Generate a unique object code based on the encoding rules and the result of the encoding generation operation, and release the exclusive lock.
[0119] After successfully generating each code segment value and passing uniqueness verification, the system begins the final encoding assembly operation. According to the code segment order defined in the encoding rules, the fixed code segment value, sequential code segment value, date code segment value, and random code segment value are concatenated in order to form the main encoding. During this process, the system automatically adds specified prefix and suffix characters to each code segment according to the configured rules to ensure the integrity and standardization of the encoding format.
[0120] After the encoding assembly is completed, the system performs a final quality check, including verifying whether the total encoding length meets the definition, checking whether the values of each code segment are within the valid range, and confirming whether the encoding format conforms to railway industry standards. Codes that pass the check will be marked as valid, ready to be returned to the requester and persistently stored in the main database.
[0121] In the final stage of the encoding generation process, the system proactively releases the dedicated lock resources acquired during concurrency control. This release operation ensures that subsequent requests under the same encoding rule can acquire the lock resources in a timely manner and continue execution, maintaining the system's high concurrency processing capabilities. After the lock is released, the system updates the rule lock mapping table to record the current state of the encoding rule instance.
[0122] The entire process ensures that, even in a distributed environment facing massive encoding requests, each generated code maintains its uniqueness, standardization, and business relevance, while simultaneously maintaining system stability and high throughput. This end-to-end encoding generation mechanism provides reliable master data identifier generation capabilities for the railway data infrastructure.
[0123] In this embodiment, when the step of automatically matching or combining an encoding rule from a predefined encoding rule library based on the core entity and its associated attributes fails, the method further includes the following steps:
[0124] The core entity and its associated attributes that cause a matching failure are stored as an unmatched pattern sample in the sample pool.
[0125] Clustering is performed on multiple unmatched pattern samples in the sample pool to form at least one sample cluster containing one or more semantically similar samples, and it is determined whether the number of samples in the sample cluster meets a preset frequency threshold.
[0126] In response to the number of samples within the sample cluster meeting the preset frequency threshold, the common entity and attribute features of the samples within the sample cluster are automatically extracted, and combined with the hierarchical relationship in the railway domain knowledge graph, a new rule creation suggestion is generated by matching from a preset meta-rule template library.
[0127] Furthermore, upon receiving confirmation from the data administrator regarding the creation of the new rule to activate a new rule, samples within the sample cluster that meet the frequency threshold are used as new training data for incremental training of the named entity recognition model.
[0128] Specifically, when executing the step of "automatically matching or combining an encoding rule suitable for the object to be encoded from a predefined encoding rule library based on the core entity and its associated attributes," if the matching score of all rules is lower than a preset success threshold, for example, set to 95%, it is determined as a matching failure. At this time, the system does not simply report an error or terminate the process, but instead initiates an unknown pattern capture and learning mechanism. This mechanism first captures the core entity and its associated attribute combination that caused the matching failure (e.g., {equipment category: 'inspection robot', model: 'XJ-G5'}) as a structured unmatched pattern sample, along with its original, unprocessed information text of the object to be encoded (e.g., "new type XJ-G5 rail inspection robot for the Beijing-Shanghai line"), and atomically stores this complete sample containing the structured pattern and the original text into a dedicated persistent storage unit, referred to here as the "unmatched sample pool." This sample pool, which could be a database table or a collection of NoSQL documents, serves to continuously accumulate all coded requests that the system cannot currently understand or process, providing a data foundation for subsequent offline analysis.
[0129] To uncover potential new coding needs from the scattered, unstructured, and unknown patterns contained in the aforementioned sample pool, the system backend is configured with a periodically executed analysis task, such as a background process triggered by a Cron job at 3:00 AM daily. This process first iterates through all samples added within a specific time window (e.g., the past seven days) in the "unmatched sample pool." For each sample, the system performs a vectorization transformation process. Specifically, the vectorization method utilizes the encoder layer of the named entity recognition model (e.g., the BERT model), which has been fine-tuned for the railway domain as mentioned in the claims, to extract word embedding vectors for each core entity (e.g., 'inspection robot') and key attribute (e.g., 'XJ-G5') in the sample. Subsequently, the system generates a comprehensive feature vector that accurately represents the position of the unmatched pattern in the semantic space by performing a weighted average calculation on these word embedding vectors. The weights can be set according to the importance or information entropy of the entity in the railway domain knowledge graph to highlight key identification information. After all new samples have been converted into feature vectors, the system employs an unsupervised clustering algorithm, preferably DBSCAN (density-based spatial clustering application), to perform cluster analysis on these feature vector sets.
[0130] The advantage of using DBSCAN is that it does not require pre-specifying the number of clusters and can automatically discover clusters of arbitrary shapes based on the distribution characteristics of the data itself. This is particularly suitable for identifying new device patterns of unknown quantity and type. The result of clustering is that semantically highly similar unmatched pattern samples (e.g., all requests for different batches of 'XJ-G5' robots) are automatically merged into the same sample cluster.
[0131] After clustering, the analysis task enters the pattern recognition and rule recommendation stage. The system examines each formed sample cluster one by one and calculates the number of samples contained within it. This number is compared with a pre-configured "frequency threshold" (e.g., set to 10). If the number of samples in a sample cluster is greater than or equal to the threshold, the system determines that the cluster represents a frequently occurring, universal business object worthy of having new coding rules established. In response, the system triggers a rule recommendation generation process. This process first analyzes all samples within the sample clusters that meet the frequency threshold. Through statistical word frequency or set intersection operations, it automatically extracts the core entities and attribute features common to all samples in this cluster. For example, common features could be {equipment category: 'inspection robot', technical feature: 'rail inspection'}. Subsequently, the system uses these common features, especially the core entity 'inspection robot', to query a pre-set railway domain knowledge graph to find its higher-level classification, standard abbreviations, or related equipment categories.
[0132] For example, a knowledge graph might reveal that 'inspection robot' belongs to the category 'line maintenance equipment', with the standard category code 'XLWH'. Based on this, the system intelligently matches from a pre-set "meta-rule template library" containing various common coding structures, selecting the most suitable template to describe this type of object, such as [equipment category code]-[model abbreviation]-[serial code]. The system then uses information retrieved from the knowledge graph to automatically fill in some code segments of the template, generating a partially instantiated rule draft, such as XLWH-[model abbreviation]-[4-digit serial code]. Finally, the system integrates this draft, the recommended filled values (such as equipment category code: XLWH), the code segments requiring manual confirmation (such as model abbreviation), and the list of original sample data that led to this recommendation into a structured "new rule creation suggestion," and pushes it to the data administrator's review interface through a workflow engine or message queue.
[0133] Finally, this mechanism activates the rules and forms a closed-loop learning process through human-machine collaboration. When the data administrator receives the aforementioned "new rule creation suggestion" on their workbench, they can review and modify it (e.g., confirming the model abbreviation as 'XJG5') and finally click "Confirm Activation." Once this confirmation instruction is received, the system will not only officially store this manually confirmed, complete new rule (e.g., XLWH-XJG5-[4-digit serial number]) in the coding rule base, making it immediately available, but will also trigger a crucial incremental model training task. This task will automatically label all sample data within the sample cluster previously determined to meet the frequency threshold as new, high-quality positive training samples (e.g., the entity label corresponding to the original text "Beijing-Shanghai Line New XJ-G5 Rail Inspection Robot" is equipment: 'XJ-G5 Inspection Robot'), and use these new samples to perform incremental fine-tuning on the online Named Entity Recognition (NER) model. This fine-tuning process enables the NER model to learn and master the ability to recognize this new type of equipment entity. Therefore, when the system receives similar encoding requests containing "XJ-G5" or its variants in the future, the semantic analysis module can directly and accurately identify this new core entity, thus flawlessly matching it to the new rule created through human-machine collaboration and entering the regular encoding generation process, without having to re-enter the unknown mode processing path. This achieves an evolution from passive execution to active learning, enabling its encoding system to continuously and intelligently improve itself along with the development of railway operations.
[0134] This embodiment also includes the following steps:
[0135] Before the actual coding request arrives, the amount of future coding demand for a specific coding rule is predicted by analyzing data from upstream business systems.
[0136] Based on the predicted demand, a dedicated lock corresponding to the specific encoding rule is obtained, and during the period of holding the dedicated lock, multiple unique codes are generated in batches, and the batch-generated unique codes are stored in a high-speed cache queue dedicated to the specific encoding rule.
[0137] After completing the batch generation, update the encoding status of the specific encoding rule and release the dedicated lock;
[0138] Furthermore, when the actual encoding request corresponding to the specific encoding rule arrives, the method no longer performs the steps of acquiring the exclusive lock and performing the encoding generation operation, but directly retrieves a pre-generated unique encoding from the cache queue in an atomic operation and uses it as a response to the request.
[0139] Specifically, this method introduces an asynchronous, background-running code pre-generation manager. This manager is configured to execute during designated low-traffic periods, such as between 1:00 AM and 4:00 AM daily, or based on real-time system load monitoring signals. Its primary task is to predict the number of coding requests each coding rule might generate within a specific future time window, such as the next 24 hours. This prediction is not a blind estimate but is achieved through data interface connections with upstream business systems, including but not limited to the railway equipment management system and the maintenance planning system. For example, the pre-generation manager can call the maintenance planning system's API to obtain the number of "CRH380A EMUs" scheduled for Level 1 maintenance the following day. If the plan shows five EMUs of this model awaiting maintenance, and each train contains eight bogies that need to be replaced and recoded, the manager can accurately predict that for a specific coding rule, namely the "EMU bogie coding rule" (let's call it RULE_BOGIE_380A), the coding requirement is at least forty. In addition, the manager will combine historical coding request statistics with a time series analysis model, such as the ARIMA model, to smooth and correct the forecast to deal with unplanned temporary demands, thereby obtaining a more robust forecast demand number, assuming it is fifty.
[0140] After determining that the predicted demand for the specific encoding rule RULE_BOGIE_380A is fifty, the pre-generation manager simulates an encoding request, proactively acquiring the corresponding dedicated lock based on the rule ID. This lock resource is preferably stored in a distributed shared memory environment, such as Redis, by attempting to acquire the key named "LOCK_RULE_BOGIE_380A". Unlike the approach of acquiring the lock and generating one code in a single request, the key here is to perform batch encoding generation within the atomic operation of successfully acquiring the dedicated lock. After acquiring the lock, the manager first connects to the database and reads the current maximum flow value associated with the rule RULE_BOGIE_380A, let's say "100". Then, instead of generating just one code, it executes a loop in memory, fifty times the predicted demand. Inside the loop, it increments the current maximum flow value from 101 to 150 sequentially, and generates fifty complete and unique object codes in succession according to the format defined by the rules, such as the length, prefix, and suffix. The result is in the form of "CRH380A-BG-0101", "CRH380A-BG-0102", and so on, up to "CRH380A-BG-0150".
[0141] After these fifty codes are generated all at once, the manager stores them as a whole, in the form of a list or queue, in a dedicated cache queue for rule RULE_BOGIE_380A. This cache queue is preferably implemented as a distributed, atomic in-memory data structure, a typical example being the List data type in Redis, with the rule ID as its unique key, such as QUEUE_RULE_BOGIE_380A. After successfully pushing the batch-generated codes into the cache queue, the manager performs a crucial database update operation: it does not update the transaction value to 101, but instead directly updates the current maximum transaction value associated with rule RULE_BOGIE_380A to "150" in one go. This step ensures that the next pre-generation or real-time generation will start from the correct position. Only after the database persistence update is successful does the manager release its dedicated lock "LOCK_RULE_BOGIE_380A". In this way, the database interactions and lock operations that originally required fifty lock-read-modify-write-unlock operations are efficiently merged into one, greatly reducing system overhead and lock contention time.
[0142] The ultimate value of this mechanism lies in the real-time processing of actual encoding requests. When a real encoding request for "CRH380A bogie" arrives from a business system, the system first matches its corresponding encoding rule ID, RULE_BOGIE_380A, through semantic analysis. At this point, unlike the basic real-time encoding generation process, this method no longer requires the steps of acquiring a dedicated lock and performing encoding generation. Instead, the encoding processing module directly accesses the corresponding cache queue QUEUE_RULE_BOGIE_380A based on the rule ID, RULE_BOGIE_380A. It performs an atomic queue pop operation, such as the LPOP command supported by Redis, retrieving a pre-generated, immediately usable unique code from the head of the queue, such as "CRH380A-BG-0101". Because operations like LPOP are atomic, even if hundreds or thousands of identical encoding requests arrive simultaneously within milliseconds, the underlying in-memory database ensures that each request obtains a different, non-repeating code until the queue is empty. Once the encoding is obtained, the system immediately returns it to the requester, completing the entire processing flow. This process involves no database reads or writes, nor does it involve the acquisition and release of dedicated locks. Its execution time depends solely on the time consumed by a single memory access, thus achieving extremely high throughput and extremely low response latency.
[0143] To ensure system robustness, a cache level monitoring mechanism is also implemented. When the length of a certain rule's cache queue falls below a preset warning level, such as below 10% of its capacity, a small-batch, urgent pre-generation task is proactively triggered to prevent cache exhaustion. If the cache does exhaust itself while requests continue to arrive, the system gracefully degrades, reverting to the aforementioned real-time locking generation mode to ensure business continuity. Through this collaborative work of predictive batch pre-generation and lock-free real-time distribution, this embodiment fundamentally solves the performance bottleneck problem in high-concurrency scenarios, providing the railway master data infrastructure with ultimate-performance coding service capabilities.
[0144] The second embodiment of the present invention proposes an intelligent coding generation system for railway master data, used to implement an intelligent coding generation method for railway master data. The system includes:
[0145] The request acquisition module is configured to respond to master data encoding requests containing information about the object to be encoded.
[0146] The semantic analysis module is configured to perform semantic analysis on the information of the object to be encoded based on a preset railway domain knowledge graph and a named entity recognition model trained on railway domain corpus, so as to extract core entities and their associated attributes.
[0147] The encoding rule acquisition module is configured to automatically match or combine an encoding rule suitable for the object to be encoded from a predefined encoding rule library based on the core entity and its associated attributes.
[0148] The encoding module is configured to acquire a dedicated lock corresponding to the encoding rule based on the unique identifier of the encoding rule, and to perform an encoding generation operation after acquiring the dedicated lock. Multiple encoding requests with the same unique identifier of the encoding rule are serialized through the dedicated lock, while multiple encoding requests with different unique identifiers of the encoding rule are parallelized.
[0149] Based on the encoding rules and the result of the encoding generation operation, a unique object code is generated, and the exclusive lock is released.
[0150] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process and related explanations of the methods described above can be found in the corresponding processes in the foregoing system embodiments, and will not be repeated here.
[0151] It should be noted that the intelligent coding generation system for railway master data provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the modules or steps in the embodiments of the present invention can be further decomposed or combined. For example, the modules in the above embodiments can be merged into one module, or further divided into multiple sub-modules to complete all or part of the functions described above. The names of the modules and steps involved in the embodiments of the present invention are only for distinguishing the various modules or steps and are not considered as an improper limitation of the present invention.
[0152] An electronic device according to a third embodiment of the present invention includes:
[0153] At least one processor;
[0154] and a memory communicatively connected to at least one of the processors;
[0155] The memory stores instructions that can be executed by the processor to implement the above-described intelligent coding generation method for railway master data.
[0156] A computer-readable storage medium according to a fourth embodiment of the present invention stores computer instructions, which are executed by the computer to implement the above-described intelligent coding generation method for railway master data.
[0157] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process and related descriptions of the storage device and processing device described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0158] The terms “first”, “second”, etc., are used to distinguish similar objects, not to describe or indicate a specific order or sequence.
[0159] The term "comprising" or any other similar term is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus / device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent in such process, method, article, or apparatus / device.
[0160] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.
Claims
1. A method for intelligent coding and generating railway master data, characterized in that, Includes the following steps: Responding to a master data encoding request containing information about the object to be encoded; Based on a pre-set railway domain knowledge graph and a named entity recognition model trained on railway domain corpus, semantic analysis is performed on the information of the object to be encoded in order to extract core entities and their associated attributes. Based on the core entity and its associated attributes, an encoding rule suitable for the object to be encoded is automatically matched or combined from a predefined encoding rule library; Based on the unique identifier of the encoding rule, a dedicated lock corresponding to the encoding rule is obtained, and after obtaining the dedicated lock, the encoding generation operation is performed. Among them, multiple encoding requests with the same unique identifier of the encoding rule are serialized through the dedicated lock, while multiple encoding requests with different unique identifiers of the encoding rule are parallelized. Based on the encoding rules and the result of the encoding generation operation, a unique object code is generated, and the exclusive lock is released.
2. The intelligent coding generation method for railway master data according to claim 1, characterized in that, Before the step of automatically matching or combining an encoding rule, the method further includes a step of configuring the encoding rule base, which includes: For code segments of fixed code type, configure its code segment name, fixed code value, code segment prefix and suffix, and associate the fixed code value with the railway industry standard code; For sequential code segments, configure their bit length, step size, starting value, and padding value, and additionally configure railway equipment category attributes so that sequential codes with the same code segment paradigm are grouped and counted independently according to equipment category; For date code type segments, configure them to support railway year or maintenance cycle formats and associate them with equipment categories; For random code types, their generation is associated with device category and key attributes.
3. The intelligent coding generation method for railway master data according to claim 1, characterized in that, Semantic analysis is performed based on a pre-defined railway domain knowledge graph and named entity recognition model, including: Using the named entity recognition model, entities are identified from the information of the object to be encoded, and the entities include at least railway-specific abbreviations and equipment models; In the railway domain knowledge graph, query the hierarchical relationships or functional attributes between the core entities; Based on the queried hierarchical relationships or functional attributes, the classification and characteristics of the object to be encoded are determined for matching the encoding rules.
4. The intelligent coding generation method for railway master data according to claim 1, characterized in that, The mechanism for obtaining a private lock based on the unique identifier of the encoding rule includes: Assign a unique identifier to each encoding rule; In distributed shared memory, the mapping relationship between the unique identifier and the dedicated lock resource is maintained; When an encoding request arrives, the corresponding dedicated lock resource is located and acquired in the distributed shared memory based on the unique identifier of the encoding rule corresponding to the request.
5. The intelligent coding generation method for railway master data according to claim 1, characterized in that, When the encoding rule includes a serial number, the encoding generation operation includes: After acquiring the exclusive lock, read the current maximum flow value associated with the unique identifier of the encoding rule; Based on the preset step size and bit length, a new serial number is calculated on the basis of the current maximum serial number value; The new maximum serial number corresponding to the new serial number will be persistently updated, and the dedicated lock will be released.
6. The intelligent coding generation method for railway master data according to claim 1, characterized in that, When the encoding rule contains a random code, the encoding generation operation includes: Using a dedicated lock mechanism, an initial true random seed is generated for each unique identifier of the encoding rule, and this seed is stored in the database as the maximum seed value under that rule. When performing random code generation, after acquiring the exclusive lock, the maximum seed value is read and incremented as a new seed value for the pseudo-random number generation algorithm to calculate a new random code. Furthermore, before releasing the exclusive lock, the new seed value is updated back to the database as the new maximum seed value.
7. The intelligent coding generation method for railway master data according to claim 3, characterized in that, The named entity recognition model is trained through the following steps: Using a pre-trained language model as the base model; and The basic model was fine-tuned using a railway-related corpus containing railway equipment names, technical parameters, and maintenance records.
8. The intelligent coding generation method for railway master data according to claim 1, characterized in that, When the step of automatically matching or combining an encoding rule from a predefined encoding rule library based on the core entity and its associated attributes fails, the method further includes the following steps: The core entity and its associated attributes that cause a matching failure are stored as an unmatched pattern sample in the sample pool. Clustering is performed on multiple unmatched pattern samples in the sample pool to form at least one sample cluster containing one or more semantically similar samples, and it is determined whether the number of samples in the sample cluster meets a preset frequency threshold. In response to the number of samples within the sample cluster meeting the preset frequency threshold, the common entity and attribute features of the samples within the sample cluster are automatically extracted, and combined with the hierarchical relationship in the railway domain knowledge graph, a new rule creation suggestion is generated by matching from a preset meta-rule template library. Furthermore, upon receiving confirmation from the data administrator regarding the creation of the new rule to activate a new rule, samples within the sample cluster that meet the frequency threshold are used as new training data for incremental training of the named entity recognition model.
9. A smart coding generation system for railway master data, used to implement the smart coding generation method for railway master data as described in any one of claims 1-8, characterized in that, The system includes: The request acquisition module is configured to respond to master data encoding requests containing information about the object to be encoded. The semantic analysis module is configured to perform semantic analysis on the information of the object to be encoded based on a preset railway domain knowledge graph and a named entity recognition model trained on railway domain corpus, so as to extract core entities and their associated attributes. The encoding rule acquisition module is configured to automatically match or combine an encoding rule suitable for the object to be encoded from a predefined encoding rule library based on the core entity and its associated attributes. The encoding module is configured to acquire a dedicated lock corresponding to the encoding rule based on the unique identifier of the encoding rule, and to perform an encoding generation operation after acquiring the dedicated lock. Multiple encoding requests with the same unique identifier of the encoding rule are serialized through the dedicated lock, while multiple encoding requests with different unique identifiers of the encoding rule are parallelized. Based on the encoding rules and the result of the encoding generation operation, a unique object code is generated, and the exclusive lock is released.
10. An electronic device, characterized in that, include: At least one processor; and a memory communicatively connected to at least one of the processors; The memory stores instructions that can be executed by the processor to implement the intelligent coding generation method for railway master data as described in any one of claims 1-8.
Citation Information
Patent Citations
Railway main data full life circle management method and railway main data full life circle management system
CN105117446A
AI Agent agent implementation method based on large language model and knowledge graph
CN120822537A