Identification resolution method, apparatus, device, and storage medium
By using nested identifier templates and parallel attribute value query tasks, the high complexity and long processing time caused by layer-by-layer parsing and frequent API calls in existing technologies are solved, enabling rapid parsing and efficient management of complex product structures.
Patent Information
- Application Number
- CN202411934916.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2044-12-25
AI Technical Summary
Existing technologies require layer-by-layer analysis and frequent API calls when analyzing product composition structures, resulting in high complexity and long processing times, making it difficult to meet the real-time traceability and efficiency requirements of industrial production lines.
By designing nested identifier templates, recording the identifiers to be parsed and their associated nested identifiers and attributes, generating parallel attribute value query tasks, and using data query interfaces to quickly obtain the product composition structure.
It improves the parsing efficiency and speed for complex products with nested hierarchies, meeting the needs of real-time traceability and efficient management in the Industrial Internet.
Smart Images

Figure CN119883273B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of identifier resolution, and more particularly to identifier resolution methods, apparatus, devices, and storage media. Background Technology
[0002] With the rapid development of the Industrial Internet, the relationships between products and their sub-items such as components and raw materials are becoming increasingly complex. Current technologies for analyzing product composition typically require first parsing the product identifier, and then repeatedly calling Application Programming Interfaces (APIs) to obtain sub-items and their nested information. This layer-by-layer parsing and frequent API calls increase the complexity and time consumption of the parsing process, and also affect its efficiency. Especially in scenarios requiring the processing of massive amounts of data, such as real-time traceability and quality inspection of industrial production lines, the increasing complexity of the hierarchical nesting structure between products and components / raw materials significantly reduces the efficiency of data parsing and combination, leading to excessively long parsing times and failing to meet the demands for real-time and efficient data display. Summary of the Invention
[0003] Based on the above problems, embodiments of this application provide an identifier resolution method, apparatus, device, and storage medium, with the aim of improving the data resolution efficiency for the hierarchical nested structure of industrial products, while ensuring the traceability of the resolution results.
[0004] In a first aspect, embodiments of this application provide an identifier resolution method, including:
[0005] Receive the input identifier to be parsed;
[0006] Obtain the nested identifier template corresponding to the identifier to be parsed;
[0007] Based on the nested identifier template corresponding to the identifier to be parsed, the identifier to be parsed is parsed to obtain the first attribute of the identifier to be parsed and the second attribute of the nested identifier associated with the identifier to be parsed;
[0008] For the first attribute of the identifier to be parsed and the second attribute of the nested identifier, generate an attribute value query task;
[0009] Call the data query interface to execute the attribute value query task to obtain the attribute value of the first attribute and the attribute value of the second attribute;
[0010] The identifier to be parsed, the first attribute, the attribute value of the first attribute, the nested identifier, the second attribute, and the attribute value of the second attribute are concatenated and displayed.
[0011] Secondly, embodiments of this application also provide an identifier resolution apparatus, comprising:
[0012] A receiving unit is used to receive the input identifier to be parsed;
[0013] The acquisition unit is used to acquire the nested identifier template corresponding to the identifier to be parsed;
[0014] The identifier parsing unit is used to parse the identifier to be parsed according to the nested identifier template corresponding to the identifier to be parsed, so as to obtain the first attribute of the identifier to be parsed and the second attribute of the nested identifier associated with the identifier to be parsed;
[0015] The task generation unit is used to generate an attribute value query task for the first attribute of the identifier to be parsed and the second attribute of the nested identifier;
[0016] The task execution unit is used to call the data query interface to execute the attribute value query task in order to obtain the attribute value of the first attribute and the attribute value of the second attribute.
[0017] The data splicing unit is used to splice and display the identifier to be parsed, the first attribute, the attribute value of the first attribute, the nested identifier, the second attribute, and the attribute value of the second attribute.
[0018] Thirdly, embodiments of this application also provide a computer device, including:
[0019] Central processing unit, memory, input / output interfaces;
[0020] The memory is either a short-term storage memory or a persistent storage memory;
[0021] The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform any of the aforementioned identifier resolution methods.
[0022] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program thereon, wherein when the computer program is executed by a processor, it performs any of the identifier resolution methods described above.
[0023] Fifthly, embodiments of this application also provide a computer program product, the computer program product including computer instructions, which, when executed by a processor, implement any of the aforementioned identifier resolution methods.
[0024] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0025] This application embodiment utilizes nested identifier templates to more quickly obtain the first attribute of the identifier to be parsed, the nested identifiers associated with the identifier to be parsed, and the second attribute of the nested identifiers. The attribute value query task generated based on the first and second attributes supports parallel execution and can significantly improve the parsing efficiency and speed for products with complex nesting levels and their associated sub-items. Furthermore, by concatenating and displaying the attribute values of the first and second attributes obtained after the attribute value query task is completed with the identifier to be parsed, the first attribute, and the second attribute, a more intuitive view of the product's structural composition can be presented, meeting the needs of real-time traceability and efficient management in the Industrial Internet. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0027] Figure 1 This application provides a schematic diagram of the system architecture for an identifier resolution method.
[0028] Figure 2 This is a schematic flowchart of an identifier resolution method provided in an embodiment of this application;
[0029] Figure 3 This application provides a schematic diagram of a nested identifier template construction process.
[0030] Figure 4 This is a schematic diagram of another identifier resolution method provided in an embodiment of this application;
[0031] Figure 5 This is a schematic diagram of the structure of an identifier resolution device provided in an embodiment of this application;
[0032] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0033] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0034] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0035] In the following description, expressions such as "one specific implementation" or "one specific example" describe a subset of all possible embodiments. However, it is understood that "one specific implementation" or "one specific example" can be the same or different subset of all possible embodiments and can be combined with each other without conflict. In the following description, the term "multiple" means at least two. When a certain value mentioned in this application reaches a threshold (if it exists), in some specific examples, it may include the former being greater than the latter. When "any" or "at least one" or similar expressions are mentioned, it specifically refers to any one of the listed examples or any combination of these examples.
[0036] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0037] The method provided in this application embodiment can be applied to, for example, Figure 1 In the system architecture shown, terminal 102 communicates with server 101 via a network, and data storage system 100 can store data that server 101 needs to process or requires. Data storage system 100 can be integrated onto server 101 or located in the cloud or on other network servers. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices, such as smartwatches, smart bracelets, and head-mounted devices. Server 101 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0038] Terminal 102 can receive an input identifier to be parsed and send it to server 101. Server 101 will obtain the corresponding nested identifier template based on the received identifier and parse the identifier. Server 101 can also generate an attribute value query task based on the first attribute and the second attribute to obtain the attribute values of the first attribute and the second attribute. In addition, server 101 can also concatenate the obtained identifier to be parsed, the first attribute, the attribute value of the first attribute, the nested identifier, the second attribute, and the attribute value of the second attribute and return them to terminal 102 for display. In this way, the composition structure of the product is automatically parsed, and the specific attribute values of each sub-item that makes up the product are quickly obtained and displayed, meeting the needs of real-time traceability and efficient management in the Industrial Internet.
[0039] It should be noted that the methods provided in this application embodiment can be implemented jointly by the terminal device and the server as described above, or they can be implemented entirely on the server side, or they can be implemented entirely on the terminal device side. The specific implementation can be determined according to the actual application scenario, and no restrictions are imposed here.
[0040] The following describes the existing methods for parsing data related to industrial products. In existing technologies, the product identifier must first be parsed, and then an API is called to query the information of related sub-items (i.e., sub-item identifiers) one by one based on the product identifier. Next, each sub-item identifier is parsed individually. Specifically, this means calling the API to query the relevant information of the sub-item based on its identifier; if the returned information contains nested sub-item identifiers, the API must be called again to obtain the relevant information of those nested sub-item identifiers. It is evident that the existing product parsing process requires parsing the product layer by layer and frequent API calls, which not only increases parsing complexity and execution time but also severely impacts parsing efficiency, making it difficult to meet the requirements of efficient processing and real-time performance.
[0041] To address these issues in the prior art, this application proposes a nested identifier template to integrate data on a product and its constituent components or raw materials, forming an organic association. For ease of description, the product's components and raw materials are collectively referred to as sub-items. Sub-items are linked through the nested identifier template. When it is necessary to know the composition of a product, the nested identifier template allows for faster identification of which sub-items comprise the product, thereby enabling more rapid retrieval of their specific data and improving the efficiency and accuracy of data processing.
[0042] The method of this application will be further described in detail below, and some specific possible implementation examples will be provided. In practical applications, the implementation content of these examples can be combined or implemented separately as needed according to the corresponding functional principles and application logic. If combined, the execution order between the combined examples can be determined according to their respective processing logic, which can be determined according to the actual scenario.
[0043] Please see Figure 2 This application provides an identifier resolution method, such as... Figure 2 As shown, the method includes steps S201-S206.
[0044] S201: Receive the input identifier to be parsed.
[0045] The identifier to be parsed refers to the input object in the product structure parsing process, which can be understood as the root identifier in the aforementioned nested identifier template. The identifier to be parsed is used to indicate a specific product object that needs to be parsed, such as a mobile phone or a computer. The form of the identifier to be parsed can be set according to the actual situation, and this application does not impose specific limitations on it. For example, the identifier to be parsed can be a number, a hierarchical path, or a string, etc.
[0046] During the parsing process, the core function of the identifier to be parsed is to determine the nested identifier template corresponding to it. Through the nested identifier template, the sub-items associated with the product corresponding to the identifier can be quickly obtained, and the attribute data of the sub-items can be further obtained, spliced and displayed, thereby generating a complete structured data view of the product.
[0047] S202: Obtain the nested identifier template corresponding to the identifier to be parsed;
[0048] In this embodiment of the application, the nested identifier template records the identifier to be parsed, the first attribute of the identifier to be parsed, the nested identifier associated with the identifier to be parsed, and the second attribute of the nested identifier. For example... Figure 3 As shown, the process of generating nested identifier templates can be accomplished by receiving the composition structure of each sub-item predefined according to business requirements. For example, Figure 3 The identifier 1 on the left and its subordinate attributes 1, 2, 3, and 4 represent a regular identifier. Its subordinate data does not contain nested identifiers, so identifier 1 can be regarded as a child item equivalent to a leaf node.
[0049] Figure 3The middle identifier 2 can be considered a specific identifier for a product. The identifier corresponding to a product is usually a nested identifier. For example, identifier 2 contains three independent attributes (attribute 5, attribute 6, and attribute 7), as well as the nested identifier 1 and attributes 1, 2, 3, and 4 under identifier 1. Attributes 5, 6, and 7 of identifier 2 can be considered as the first attributes of identifier 2, identifier 1 can be considered as a nested identifier associated with identifier 2, and attributes 1, 2, 3, and 4 under identifier 1 are the second attributes of identifier 1.
[0050] When generating nested identifier templates, unique identifiers can be defined for all attributes under identifier 2 (attributes 5, 6, and 7), and for identifier 1 and its subordinate attributes (attributes 1, 2, 3, and 4), to indicate the hierarchical position of each attribute. For example, Figure 3 The rightmost nested identifier template displays the top-level attributes (attributes 5, 6, and 7) of identifier 2, which are assigned unique identifiers 1, 2, and 3 respectively. At the same time, a unique identifier 4 is assigned to nested identifier 1, and attributes 1, 2, 3, and 4 under identifier 1 are attached to the unique identifier 4 of identifier 1. For example, 4.1 indicates that attribute 1 under identifier 1 is the first child node under the fourth node (identifier 1) of identifier 2.
[0051] It should be noted that the specific form of the unique identifier is not limited in this application embodiment. For example, it can also be a combination of letters and numbers, such as A1, B2.1, etc.; or a tree-like path identifier, that is, a hierarchical path representation, for example, attribute 1 under identifier 1 associated with attribute 1 of identifier 2 can be represented as "1 / 4 / 4.1"; or it can be represented by a universally unique identifier (UUID), such as the unique identifier of attribute 1 being 550e8400; in addition, rule numbers can be defined according to business needs, for example, P001-A5 can be used to represent the 5th attribute of product identity (ID, Identity) as P001. Furthermore, in actual use, the identifier to be parsed (also as...) Figure 3 The identifier 2) can use specific product names, such as mobile phones, computers, etc.; nested identifiers and their second attributes, that is... Figure 3 The identifiers 1, 5, and 1 in the code can be represented by the specific names of the components or raw materials, such as batteries, hard drives, and central processing units.
[0052] Through this process, intelligent generation is possible. Figure 3 The nested identifier template shown on the right is identified as the template corresponding to product identifier 2. If the identifier to be parsed is subsequently received as identifier 2, the corresponding nested identifier template can be quickly matched and parsed, thereby obtaining the sub-item data that makes up product identifier 2 more quickly. This provides a more efficient and more relevant solution for data management and querying of complex product structures.
[0053] S203: Based on the nested identifier template corresponding to the identifier to be parsed, parse the identifier to be parsed to obtain the first attribute of the identifier to be parsed and the second attribute of the nested identifier associated with the identifier to be parsed.
[0054] Specifically, based on the nested identifier template corresponding to the identifier to be parsed, the received identifier to be parsed can be used as the current node, and the current node can be parsed to obtain the parsed data of the current node; wherein, when the identifier to be parsed is used as the current node, the parsed data of the current node includes the first attribute of the current node, and at least one nested identifier associated with the current node;
[0055] If the parsed data of the current node contains one or more associated nested identifiers, then these nested identifiers need to be parsed further. Specifically, for each nested identifier, the nested identifier is treated as the current node, and the step of "parsing the current node to obtain the parsed data of the current node" is returned, until there are no nested identifiers associated with the current node in the parsed data. At this point, the parsing of the node and all its child nodes is complete. When a nested identifier is used as the current node, the parsed data of the current node includes: the second attribute of the current node, and / or, the nested identifiers associated with the current node.
[0056] This application embodiment uses a nested identifier template to pre-record the identifier to be parsed and its first attribute, as well as the nested identifiers associated with the identifier to be parsed and their second attributes. This allows the parsing process to directly obtain the association relationship between the product and its sub-items through the nested identifier template, avoiding repeated API calls during recursive parsing. The parsing process in this application embodiment is template-driven, enabling rapid location and parsing of the identifier to be parsed and its nested identifiers, significantly shortening parsing time, improving the simplicity and stability of the parsing process, and meeting the parsing needs of complex, multi-level nested products in the Industrial Internet.
[0057] S204: Generate an attribute value query task for the first attribute of the identifier to be parsed and the second attribute of the nested identifier;
[0058] Attribute value query tasks are used to retrieve the value of a specified attribute from a data source (such as a database, API interface, etc.). Each first attribute and each second attribute corresponds to a separate attribute value query task. Each attribute value query task typically includes attribute information (the name of the attribute to be queried, such as "hard drive", "battery", or...). Figure 3 The query target (i.e., the identifier of the attribute, such as the unique identifier assigned to each attribute or identifier mentioned above, such as UUID or hierarchical path) and query conditions, etc.
[0059] This application's embodiments generate attribute value query tasks for the first attribute of the identifier to be parsed and the second attribute of the nested identifier. This involves decomposing these attributes into independent query units, clarifying the query targets (attribute name, associated identifier) and query scope of different attribute value query tasks, and organizing them into a task queue for subsequent parallel execution. In this way, the main component information of the product can be quickly obtained, significantly improving the efficiency and speed of data querying, thereby meeting the needs of high concurrency and real-time data processing.
[0060] S205: Call the data query interface to execute the attribute value query task to obtain the attribute value of the first attribute and the attribute value of the second attribute;
[0061] To obtain the specific attribute values of the first and second attributes from the data source, the data query interface provided by the system can be used to complete the specific execution of the attribute value query task. The data query interface may include: (1) API interface, used to call external or internal services to query the required data. For example, attribute values can be obtained through RESTful interface (a network API interface designed based on the REST (Representational State Transfer) architectural style) or GraphQL (GraphQuery Language) interface; (2) Second-level node interface, used in distributed systems to obtain data by calling the second-level node interface such as database sharding or cache nodes. Data query interface calls can process multiple attribute value query tasks in parallel, accelerate the data acquisition process, and improve the efficiency of querying and managing the internal structure of the product.
[0062] S206: Concatenate and display the identifier to be parsed, the first attribute, the attribute value of the first attribute, the nested identifier, the second attribute, and the attribute value of the second attribute.
[0063] The data concatenation method can be flexibly defined according to system or user needs. For example, data can be concatenated through indentation or nested structures, or converted to formats such as tables, comma-separated values (CSV), or JavaScript object notation (JSON) for concatenation. Alternatively, reporting tools can be used to concatenate the data and export it to the desired file format. The output can be displayed on the interface as a tree diagram or in the form of tables.
[0064] For example, the nested identifier template corresponding to the mobile phone can set the identifier corresponding to the mobile phone as identifier 2. The attributes under identifier 2 include CPU (attribute 5), memory (attribute 6), and battery (attribute 7). Identifier 1, which is nested and associated with identifier 2, is the CPU. The attributes under identifier 1 include CPU type (attribute 1), number of cores (attribute 2), frequency (attribute 3), and wafer (attribute 4). Identifier 1 has a preset associated nested identifier, namely identifier 4, which corresponds to the wafer. The attributes of the wafer include manufacturer (attribute 10) and serial number (attribute 11). The following is a data display table (Table 1 below), showing the splicing result of the relevant attributes and attribute values of the mobile phone (identifier 2) and its nested identifiers.
[0065] Table 1
[0066]
[0067] In summary, this application's embodiments effectively solve the problems of weak data association and data isolation by recording a nested identifier template containing the identifier to be parsed, the first attribute of the identifier to be parsed, the nested identifier associated with the identifier to be parsed, and the second attribute of the nested identifier. Using the nested identifier template, the first attribute of the identifier to be parsed, the nested identifier associated with the identifier to be parsed, and the second attribute of the nested identifier can be obtained more quickly. Attribute value query tasks generated based on the first and second attributes support parallel execution and can significantly improve the parsing efficiency and speed for products with complex nesting levels and their associated sub-items. Furthermore, by concatenating and displaying the attribute values of the first and second attributes obtained after the attribute value query task is completed with the identifier to be parsed, the first attribute, and the second attribute, a more intuitive view of the product's composition structure can be presented, meeting the needs of real-time traceability and efficient management in the Industrial Internet.
[0068] Based on the examples above, the following will combine... Figure 4 Provide some specific possible implementation examples.
[0069] based on Figure 2In some specific examples, to improve adaptability to complex business needs and ensure the integrity and accuracy of the obtained attribute value data, each attribute (i.e., each first attribute and each second attribute) can be configured with validation rules. When obtaining the nested identifier template corresponding to the identifier to be parsed, if the template's attributes have validation rules, the template processor will parse the validation rules corresponding to the attributes to subsequently verify the validity of the attributes. If there are multiple first and second attributes, the specific operation process of step S204 may include: validating each first attribute and each second attribute based on the preset validation rules corresponding to each first attribute and each second attribute; generating corresponding attribute value query tasks for each first attribute and each second attribute that passes the validation.
[0070] For example, each attribute is validated using preset validation rules to ensure that it conforms to business logic rules before generating attribute value query tasks. These preset validation rules may include format checks, value range validation, and relationship validation. If an attribute passes validation, a corresponding attribute generation query task can be generated to retrieve the attribute's specific value from the data source. The attribute value query tasks generated after validation using the preset rules can then be placed in a task queue to await processing.
[0071] The embodiments of this application can first verify and then generate attribute value query tasks by using preset verification rules for each first attribute or each second attribute. This can filter out invalid or non-compliant attributes to avoid wasting query resources, while also ensuring that the generated attribute value query tasks only target valid attributes, thereby improving the accuracy of the attribute values obtained after the query tasks are completed.
[0072] based on Figure 2 In some specific examples, when generating attribute value query tasks, attribute validation can be omitted, and all attribute value query tasks corresponding to all attributes can be generated directly. In the stage between task generation and execution, rule validation is performed on the attributes corresponding to each attribute value query task. Only attribute value query tasks that pass validation are actually executed. Compared to the previous embodiment where validation is performed before generating attribute value query tasks, this approach is more suitable for scenarios with complex rules or those requiring real-time dynamic adjustments, thereby avoiding delays caused by complex rules during the task generation stage.
[0073] Specifically, if there are multiple first attributes and multiple second attributes, the specific operation process of step S205 may include: determining the target attribute corresponding to the attribute value query task; the target attribute includes the first attribute and the second attribute; verifying the target attribute corresponding to the attribute value query task based on the preset verification rules corresponding to the target attribute; for each attribute value query task, if the target attribute corresponding to the attribute value query task passes the verification, calling the data query interface to execute the attribute value query task to obtain the attribute value of the target attribute.
[0074] This application embodiment can preset verification rules for each first attribute or each second attribute. For ease of description, either the first attribute or the second attribute will be referred to as the "target attribute" below. Each attribute value query task is verified based on the target attribute corresponding to each attribute value query task. Specifically, assuming attribute value query task A corresponds to target attribute A1, attribute value query task A is verified according to the preset verification rules for attribute A1. If the target attribute A1 corresponding to attribute value query task A passes the verification, then attribute value query task A can be directly submitted to the task pool to call the data query interface to execute the attribute value query to obtain the attribute value of the target attribute.
[0075] It should be noted that, please refer to Figure 4 In this embodiment, the attribute value query task to be verified is located in a task queue. Attribute value query tasks in the task queue can be submitted to a task pool for processing. Specifically, the task pool can be understood as a collection that manages verified attribute value query tasks, used to store and schedule all attribute value query tasks related to each root identifier (e.g., identifier 2 corresponding to a product). This includes attribute value query tasks corresponding to the first attribute under identifier 2, and attribute value query tasks for the second attribute of nested identifier 1 associated with identifier 2. To coordinate the interaction between the task pool and the thread pool, a listening thread can be introduced. The listening thread monitors the task status in the task pool in real time, for example, dynamically adjusting the task scheduling strategy based on the task pool status, pausing task queue processing when the task pool capacity is insufficient, replenishing new tasks from the task queue after tasks are taken from the task pool, or triggering further task scheduling and thread resource allocation after new tasks are added to the task pool. The thread pool is used to manage and execute multiple threads. The thread pool contains a predefined number of threads, which can retrieve tasks from various task pools for parallel processing. The three components work together, managing tasks through a task pool, scheduling tasks by listening to the task pool through a listening thread, and executing tasks through a thread pool. This can further provide efficient concurrency capabilities and enable efficient querying and parsing of attribute values for complex nested identifiers.
[0076] It should be noted that the generation of attribute value query tasks mentioned above can use the ReentrantLock class in Java to manage the addition and deletion of tasks in the task queue, ensuring that only one thread can modify the task queue at a time, thereby solving the problem of contention for shared resources.
[0077] based on Figure 2 In some specific examples, there are multiple first and second attributes. The preset validation rule is based on the input source identifier and the query source identifier. The validation process of the preset validation rule includes: obtaining the input source of the identifier to be parsed and determining the input source identifier of the input source; obtaining the creation source identifier of the first attribute and the creation source identifier of the second attribute; the creation source identifier is used to identify the creation source of the first attribute or the second attribute; validating each first attribute and each second attribute according to the creation source identifier of the first attribute, the creation source identifier of the second attribute, and the input source identifier; if the creation source identifier of the first attribute is the same as the input source identifier, the validation of the first attribute passes; if the creation source identifier of the second attribute is the same as the input source identifier, the validation of the second attribute passes.
[0078] Specifically, in this embodiment of the application, the target attribute is compared with the creation source identifier (indicating the source of the attribute) and the input source identifier (indicating the source of the current initiator of parsing the identifier to be parsed) to determine whether the target attribute meets the requirements of the current business, thereby deciding whether to pass the verification.
[0079] Here, the input source identifier can be a unique identifier (such as a serial number, network address, etc.) from an Enterprise Resource Planning (ERP) system, a Manufacturing Execution System (MES), or a specific device, indicating that the request to parse the identifier was initiated by this system or device. Alternatively, the input source identifier can also be a user's (such as the data uploader's) account identity ID or number. For example, it can be obtained from the user's login session or by parsing the account ID or number from the token used by the user when initiating the request or logging into the system.
[0080] The creation source indicates the origin of an attribute, used to identify the data source of a particular attribute. For example, during the attribute entry or generation process, the system will automatically assign a creation source identifier to it, or the unique identifier of the device or user performing the attribute entry / data upload will be directly used as the creation source identifier.
[0081] In one feasible embodiment, the creation source identifier of attribute 25 can be obtained: account ID-56789; and the input source identifier when obtaining the input identifier to be parsed can be obtained: account ID-23456. It can be seen that if the creation source identifier and the input source identifier are inconsistent, then attribute 25 will not be able to generate an attribute value query task, or the attribute value query task corresponding to attribute 25 will not be submitted to the task pool to execute the attribute value query.
[0082] based on Figure 2 In some specific examples, there are multiple first and second attributes. To prevent attributes from being accessed without authorization and to ensure data security, the preset verification rule can be set to verification based on the input time. The verification process of the preset verification rule includes: obtaining the input time of the input identifier to be parsed; obtaining the restricted access time period of the first attribute and the restricted access time period of the second attribute; verifying each first attribute and each second attribute according to the restricted access time period of the first attribute, the restricted access time period of the second attribute, and the input time; if the input time is within the restricted access time period of the first attribute, the verification of the first attribute passes; if the input time is within the restricted access time period of the second attribute, the verification of the second attribute passes.
[0083] In one feasible embodiment, assuming that the restricted access time for attribute 25 is 09:00-15:00, and the time when the identifier to be parsed is entered (i.e. the time when the parsing request for the identifier to be parsed is initiated) is 15:01, since the input time (the time when the parsing request for the identifier to be parsed is initiated) is not within the restricted access time period of the attribute, the system will not generate an attribute value query task for the corresponding attribute 25, or the attribute value query task for attribute 25 will not be submitted to the task pool for query execution.
[0084] It should be noted that the specific units for limiting access time and input time are not limited in the embodiments of this application. For example, the verification of limiting access time and input time can be accurate to seconds or microseconds, or it can be based on dates (such as year, month, day). The specific precision can be set according to actual needs.
[0085] This application embodiment effectively prevents unauthorized access during specific time periods by verifying the restricted access time period for each attribute and the input time of the current identifier to be parsed, thereby ensuring the security and compliance of data access.
[0086] based on Figure 2In some specific examples, after generating attribute value query tasks for the first attribute of the identifier to be parsed and the second attribute of the nested identifier, the method of this application embodiment further includes: submitting the attribute value query tasks to a task pool; reading attribute value query tasks with a preset task processing capacity from the task pool, and planning the attribute value query tasks with the preset task processing capacity as attribute value query tasks in the same task execution round; and sequentially allocating corresponding task threads to the attribute value query tasks in the same task execution round to execute each attribute value query task in each task execution round in parallel.
[0087] In practical applications, there may be a large number of attribute value query tasks. Executing all tasks directly will lead to resource contention, system resource overload, system bottlenecks, and thus reduce the efficiency of task execution.
[0088] Therefore, this embodiment manages multiple tasks through a task pool corresponding to each product, and can dynamically adjust the task execution strategy according to the system load. For example, if 50 tasks are submitted to the task pool, tasks are read from the task pool in rounds of 10. The first round of task execution includes tasks 1-10; the second round of task execution includes tasks 11-20, and so on. In the first round, the 10 tasks are assigned to 10 threads for parallel execution. After the first round is completed, the second round continues until all 50 tasks are completed in rounds.
[0089] Managing tasks through task pools, scheduling tasks by rounds, and executing tasks in parallel using thread pools can effectively improve task execution efficiency and resource utilization. This is suitable for scenarios such as the Industrial Internet that require processing a large number of tasks, and provides a foundation for flexible scheduling of attribute value query tasks.
[0090] based on Figure 2 In some specific examples, to avoid system resource exhaustion or efficiency reduction due to excessively long execution time of certain tasks or deadlock issues, the method in this application embodiment further includes: calculating the cumulative execution time of each attribute value query task; if the cumulative execution time of the attribute value query task meets a preset time threshold, then stopping the attribute value query task and returning the obtained attribute values.
[0091] In practical applications, certain attribute value query tasks may take too long to execute, or even fail to complete, due to network latency, insufficient resources, or other abnormal reasons. Without execution time limits, this could block other tasks or consume resources, impacting overall system efficiency.
[0092] Therefore, the cumulative execution time of each attribute value query task can be monitored. If the task execution time exceeds a preset time threshold, the task execution is stopped to avoid resource waste or system blockage. For example, there are 10 attribute value query tasks in the task pool, and a 5-second time threshold is set for each task. The execution time of each task is recorded. If task 1 completes within 4 seconds, the result is returned normally. If task 2 does not complete within 5 seconds, task 2 is stopped, and partially obtained attribute value results are returned. It should be noted that the preset time threshold in this embodiment can be flexibly set to different time units according to the actual needs of the attribute value query tasks. For example, it can be set to 5 seconds, or to adapt to fast requests between microservices, it can be set to 100 microseconds, etc.
[0093] This application embodiment uses task execution time monitoring and a timed lock mechanism to release long-occupied resources (such as threads and locks) and allocate them to other tasks, thereby avoiding system blocking, improving system throughput, and ensuring the stability of the method execution in this application embodiment.
[0094] To implement the identifier resolution method of this application embodiment, this application embodiment also provides an identifier resolution apparatus, such as... Figure 5 As shown, the device includes:
[0095] The receiving unit 501 is used to receive the input identifier to be parsed;
[0096] The acquisition unit 502 is used to acquire the nested identifier template corresponding to the identifier to be parsed;
[0097] The identifier parsing unit 503 is used to parse the identifier to be parsed according to the nested identifier template corresponding to the identifier to be parsed, so as to obtain the first attribute of the identifier to be parsed and the second attribute of the nested identifier associated with the identifier to be parsed;
[0098] The task generation unit 504 is used to generate an attribute value query task for the first attribute of the identifier to be parsed and the second attribute of the nested identifier;
[0099] The task execution unit 505 is used to call the data query interface to execute the attribute value query task in order to obtain the attribute value of the first attribute and the attribute value of the second attribute.
[0100] The data splicing unit 506 is used to splice and display the identifier to be parsed, the first attribute, the attribute value of the first attribute, the nested identifier, the second attribute, and the attribute value of the second attribute.
[0101] In one embodiment, the task generation unit 504 is specifically used for:
[0102] Based on the preset verification rules corresponding to each first attribute and each second attribute, each first attribute and each second attribute are verified respectively;
[0103] For each of the first attribute and the second attribute that pass the verification, a corresponding attribute value query task is generated.
[0104] In one embodiment, the task execution unit 505 is specifically used for:
[0105] Determine the target attribute corresponding to the attribute value query task; the target attribute includes the first attribute and the second attribute;
[0106] Based on the preset verification rules corresponding to the target attribute, the target attribute corresponding to the attribute value query task is verified.
[0107] For each attribute value query task, if the target attribute corresponding to the attribute value query task passes the verification, the data query interface is called to execute the attribute value query task in order to obtain the attribute value of the target attribute.
[0108] In one embodiment, the device further includes: a processing unit; the processing unit is specifically used for:
[0109] Obtain the input source of the identifier to be parsed, and determine the input source identifier of the input source;
[0110] Obtain the creation source identifier of the first attribute and the creation source identifier of the second attribute; the creation source identifier is used to identify the creation source of the first attribute or the second attribute;
[0111] Based on the creation source identifier of the first attribute, the creation source identifier of the second attribute, and the input source identifier, each of the first attribute and each of the second attributes is validated;
[0112] If the creation source identifier of the first attribute is the same as the input source identifier, then the validation of the first attribute passes.
[0113] If the creation source identifier of the second attribute is the same as the input source identifier, then the validation of the second attribute passes.
[0114] In one embodiment, the processing unit is specifically used for:
[0115] Obtain the input time of the identifier to be parsed;
[0116] Obtain the restricted access time period for the first attribute and the restricted access time period for the second attribute;
[0117] Based on the restricted access time period of the first attribute, the restricted access time period of the second attribute, and the input time, each of the first attribute and each of the second attributes are validated.
[0118] If the input time is within the restricted access time period of the first attribute, then the verification of the first attribute passes.
[0119] If the input time is within the restricted access time period of the second attribute, then the verification of the second attribute passes.
[0120] In one embodiment, the task execution unit 505 is specifically used for:
[0121] Submit the attribute value query task to the task pool;
[0122] Read attribute value query tasks with a preset task processing volume from the task pool, and plan the attribute value query tasks with the preset task processing volume as attribute value query tasks in the same task execution round;
[0123] The corresponding task threads are assigned to the attribute value query tasks in the same task execution round in sequence, so that each attribute value query task in each task execution round can be executed in parallel.
[0124] In one embodiment, the task execution unit 505 is specifically used for:
[0125] Calculate the cumulative execution time for each attribute value query task;
[0126] If the cumulative execution time of the attribute value query task meets the preset time threshold, then the attribute value query task is stopped and the obtained attribute values are returned.
[0127] It should be noted that the identifier resolution device provided in the above embodiments is only illustrated by the division of the above-described program modules. In practical applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. In addition, the identifier resolution device and the identifier resolution method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.
[0128] Based on the hardware implementation of the above program modules, and in order to implement the identifier resolution method provided in this application embodiment, this application embodiment also provides a computer device, such as... Figure 6 As shown, the computer device 600 includes:
[0129] Central processing unit 601, memory 602, and input / output interface 603;
[0130] The memory 602 is a short-term storage memory or a persistent storage memory;
[0131] The central processing unit 601 is configured to communicate with the memory 602 and execute instructions in the memory 602 to perform any of the above-described identifier resolution methods.
[0132] Of course, in practical applications, the various components in the computer device 600 are coupled together through a bus system 604. It can be understood that the bus system 604 is used to realize the connection and communication between these components. In addition to a data bus, the bus system 604 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 6 The general designated all buses as Bus System 604.
[0133] The memory 602 in this embodiment is used to store various types of data to support the operation of the computer device 600. Examples of such data include any computer program used to operate on the computer device 600.
[0134] It is understood that when the processor in the computer device described above executes the computer program, it can also realize the functions of each unit in the corresponding device embodiments described above, which will not be repeated here. Exemplarily, the computer program can be divided into one or more modules / units, one or more modules / units are stored in memory and executed by the processor to complete the various embodiments of this application. One or more modules / units can be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the computer device. For example, the computer program can be divided into units in the aforementioned computer device, and each unit can implement the specific functions described in the corresponding computer device above.
[0135] Computer equipment can be desktop computers, laptops, handheld computers, and cloud servers, among other computing devices. Computer equipment may include, but is not limited to, processors and memory. Those skilled in the art will understand that processors and memory are merely examples of computer equipment and do not constitute a limitation on the computer equipment. It may include more or fewer components, or combinations of certain components, or different components. For example, computer equipment may also include input / output devices, network access devices, buses, etc.
[0136] A processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of a computer device, connecting all parts of the computer device through various interfaces and lines.
[0137] Memory can be used to store computer programs and / or modules. The processor performs various functions of the computer device by running or executing the computer programs and / or modules stored in the memory, and by accessing data stored in the memory. Memory can primarily include a program storage area and a data storage area. The program storage area can store the operating system, at least one application program required for a given function, etc.; the data storage area can store data created based on terminal usage, etc. Furthermore, memory can include high-speed random access memory, and can also include non-volatile memory, such as hard disks, RAM, plug-in hard disks, smart media cards (SMC), secure digital cards (SD), flash cards, at least one disk storage device, flash memory device, or other volatile solid-state storage devices.
[0138] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, performs any of the identifier resolution methods described above.
[0139] This application also provides a computer program product that stores a computer program / instruction thereon. When the computer program / instruction is executed by a processor, it is used to implement the identifier resolution method described in the first aspect or any specific implementation of the first aspect of this application.
[0140] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0141] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0142] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0143] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0144] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A method for resolving identifiers, characterized in that, include: Receive the input identifier to be parsed; Obtain the nested identifier template corresponding to the identifier to be parsed; Based on the nested identifier template corresponding to the identifier to be parsed, the identifier to be parsed is parsed to obtain the first attribute of the identifier to be parsed and the second attribute of the nested identifier associated with the identifier to be parsed; For the first attribute of the identifier to be parsed and the second attribute of the nested identifier, generate an attribute value query task; Call the data query interface to execute the attribute value query task to obtain the attribute value of the first attribute and the attribute value of the second attribute; The identifier to be parsed, the first attribute, the attribute value of the first attribute, the nested identifier, the second attribute, and the attribute value of the second attribute are concatenated and displayed.
2. The identifier resolution method according to claim 1, characterized in that, Both the first attribute and the second attribute are multiple. The step of generating an attribute value query task for the first attribute of the identifier to be parsed and the second attribute of the nested identifier includes: Based on the preset verification rules corresponding to each first attribute and each second attribute, each first attribute and each second attribute are verified respectively; For each of the first attribute and the second attribute that pass the verification, a corresponding attribute value query task is generated.
3. The identifier resolution method according to claim 1, characterized in that, The process of calling the data query interface to execute the attribute value query task to obtain the attribute values of the first attribute and the second attribute includes: Determine the target attribute corresponding to the attribute value query task; the target attribute includes the first attribute and the second attribute; Based on the preset verification rules corresponding to the target attribute, the target attribute corresponding to the attribute value query task is verified. For each attribute value query task, if the target attribute corresponding to the attribute value query task passes the verification, the data query interface is called to execute the attribute value query task in order to obtain the attribute value of the target attribute.
4. The identifier resolution method according to any one of claims 2 and 3, characterized in that, Both the first attribute and the second attribute are multiple, and the preset verification rule is a verification based on the input source identifier and the query source identifier; the verification process of the preset verification rule includes: Obtain the input source of the identifier to be parsed, and determine the input source identifier of the input source; Obtain the creation source identifier of the first attribute and the creation source identifier of the second attribute; the creation source identifier is used to identify the creation source of the first attribute or the second attribute; Based on the creation source identifier of the first attribute, the creation source identifier of the second attribute, and the input source identifier, each of the first attribute and each of the second attributes is validated; If the creation source identifier of the first attribute is the same as the input source identifier, then the validation of the first attribute passes. If the creation source identifier of the second attribute is the same as the input source identifier, then the validation of the second attribute passes.
5. The identifier resolution method according to any one of claims 2 and 3, characterized in that, Both the first attribute and the second attribute are multiple, and the preset verification rule is a verification based on the input time; The verification process of the preset verification rule includes: Obtain the input time of the identifier to be parsed; Obtain the restricted access time period for the first attribute and the restricted access time period for the second attribute; Based on the restricted access time period of the first attribute, the restricted access time period of the second attribute, and the input time, each of the first attribute and each of the second attributes are validated. If the input time is within the restricted access time period of the first attribute, then the verification of the first attribute passes. If the input time is within the restricted access time period of the second attribute, then the validation of the second attribute passes.
6. The identifier resolution method according to claim 1, characterized in that, After generating an attribute value query task for the first attribute of the identifier to be parsed and the second attribute of the nested identifier, the method further includes: Submit the attribute value query task to the task pool; Read attribute value query tasks with a preset task processing volume from the task pool, and plan the attribute value query tasks with the preset task processing volume as attribute value query tasks in the same task execution round; The corresponding task threads are assigned to the attribute value query tasks in the same task execution round in sequence, so that each attribute value query task in each task execution round can be executed in parallel.
7. The identifier resolution method according to claim 1, characterized in that, The method further includes: Calculate the cumulative execution time for each attribute value query task; If the cumulative execution time of the attribute value query task meets the preset time threshold, then the attribute value query task is stopped and the obtained attribute values are returned.
8. An identifier resolution device, characterized in that, include: A receiving unit is used to receive the input identifier to be parsed; The acquisition unit is used to acquire the nested identifier template corresponding to the identifier to be parsed; The identifier parsing unit is used to parse the identifier to be parsed according to the nested identifier template corresponding to the identifier to be parsed, so as to obtain the first attribute of the identifier to be parsed and the second attribute of the nested identifier associated with the identifier to be parsed; The task generation unit is used to generate an attribute value query task for the first attribute of the identifier to be parsed and the second attribute of the nested identifier; The task execution unit is used to call the data query interface to execute the attribute value query task in order to obtain the attribute value of the first attribute and the attribute value of the second attribute. The data splicing unit is used to splice and display the identifier to be parsed, the first attribute, the attribute value of the first attribute, the nested identifier, the second attribute, and the attribute value of the second attribute.
9. A computer device, characterized in that, include: Central processing unit, memory, and input / output interfaces; The memory is either a short-term storage memory or a persistent storage memory; The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform the identifier resolution method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it performs the identifier resolution method as described in any one of claims 1 to 7.
11. A computer program product, characterized in that, The computer program product includes computer instructions that, when executed by a processor, implement the identifier resolution method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Identification value query method, identification analysis server and storage medium
CN111291043A
Identification analysis method, recursive node and system
CN115357191A