Method, device and medium for parsing item codes

By setting the encoding rule identification code in the item encoding data and selecting the appropriate analysis interface using the mapping table, the problem of inconsistent item encoding analysis is solved, and the correct analysis and load balancing of item encodings of different forms and types is achieved.

CN114511217BActive Publication Date: 2025-08-29浪潮工业互联网股份有限公司

Patent Information

Application Number
CN202210087752.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-25
Publication Date
2025-08-29
Estimated Expiration
2042-01-25

AI Technical Summary

Technical Problem

In the prior art, the coding rules of different item encodings are inconsistent with the parsing rules of the parsing interface, which may lead to the problem that the item encoding cannot be parsed.

Method used

By obtaining the encoding rule identification code in the item encoding data, the first encoding rule of the item encoding is determined, and re-encoded it according to the preset second encoding rule, and using the mapping table of the pre-constructed encoding rule and the analysis interface, a suitable analysis interface is determined and selected for analysis.

Benefits of technology

It realizes correct analysis of item encoding of different forms and types, ensures load balancing of the parsing interface, and improves analysis efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114511217B_ABST
    Figure CN114511217B_ABST
Patent Text Reader

Abstract

The embodiments of this specification disclose a method, device, and medium for parsing item codes. The method includes: obtaining item code data to be parsed, wherein the item code data includes a coding rule identification code and an item code; determining a first coding rule for the item code based on the coding rule identification code; re-encoding the item code of the first coding rule based on a pre-set second coding rule to obtain a current item code; calling a pre-stored mapping table of coding rules and a coding parsing interface; determining a coding parsing interface for the current item code based on the mapping table, and completing parsing of the current item code through the coding parsing interface. The corresponding second coding rule is selected to re-encode the item code and convert it into a coding format that can be converted by the current interface. Through the format conversion, the parsing interface can parse object codes of different formats and types, and the parsing interface can obtain correct parsing results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computer technology, and in particular to a method, device, and medium for parsing item codes. Background Art

[0002] The Industrial Internet identity resolution system consists of identity resolution nodes and recursive resolution nodes. Identity resolution nodes include national top-level nodes, second-level nodes, and enterprise nodes. Each identity resolution node, with different priorities, may correspond to multiple resolution servers. The IP address and port number of each resolution server constitute a resolution interface for that resolution server.

[0003] Different parsing interfaces correspond to different parsing rules. Under different parsing rules, different parsing interfaces can parse different types of item codes. Existing techniques for parsing item codes use a method of randomly assigning parsing ports. However, due to inconsistencies between the encoding rules of different item codes and the parsing interface's parsing rules, item codes may not be parsed. Summary of the Invention

[0004] One or more embodiments of this specification provide a method, device, and medium for parsing an item code, which are used to solve the following technical problem: item code parsing is performed by randomly assigning parsing ports. Since the encoding rules of different item codes are inconsistent with the parsing rules of the parsing interface, the item code may not be parsed.

[0005] One or more embodiments of this specification adopt the following technical solutions:

[0006] One or more embodiments of this specification provide a method for parsing an item code, the method comprising:

[0007] Obtaining item coding data to be parsed, wherein the item coding data includes a coding rule identification code and an item code; determining a first coding rule for the item code based on the coding rule identification code; re-encoding the item code of the first coding rule based on a preset second coding rule to obtain a current item code; calling a pre-stored mapping table of coding rules and coding parsing interfaces; determining a coding parsing interface for the current item code based on the second coding rule and the mapping table; and completing parsing of the current item code through the coding parsing interface.

[0008] Furthermore, before calling the pre-stored mapping table of encoding rules and encoding parsing interfaces, the method also includes: pre-acquiring historical parsing codes of multiple parsing interfaces; re-encoding the multiple historical parsing codes according to the encoding rules in the historical parsing codes to obtain multiple specified type codes; constructing a mapping relationship between the parsing interface identifier and the multiple specified type codes, and storing it in the mapping table.

[0009] Furthermore, determining the code parsing interface of the current item code according to the mapping table specifically includes: determining, in the mapping table, a specified type code having the same code type as the current item code according to the code type of the current item code; determining, based on the specified type code having the same code type as the current item code and a mapping relationship between a parsing interface identifier and multiple specified type codes, multiple parsing interfaces corresponding to the specified type codes; obtaining historical parsing data of the multiple parsing interfaces, wherein the historical parsing data includes the parsing time required for each parsing interface to parse each item code, and the interface round-trip delay during the historical parsing process of each parsing interface; calculating the parsing throughput of each parsing interface according to the parsing time corresponding to the item code parsed by each parsing interface, wherein the parsing throughput is the number of parsing times per second of each parsing interface; and determining, from the multiple parsing interfaces, a parsing interface that meets the requirements according to the parsing throughput and the interface round-trip delay of each parsing interface.

[0010] Furthermore, obtaining historical parsing data of the multiple parsing interfaces specifically includes: obtaining, through the parsing records of each parsing interface, multiple historical item codes that have been parsed by each parsing interface, wherein the parsing records include the time when the parsing request for each historical item code is received and the time when the parsing interface returns the request processing result; calculating the time difference between a first time and a second time, and using the time difference as the round-trip delay for the parsing interface to parse the historical item code, wherein the first time is the time when the parsing request for each historical item code is received, and the second time is the time when the parsing interface returns the request processing result; calculating multiple round-trip delays for the parsing interface to parse the multiple historical item codes, and calculating an average of the multiple round-trip delays as the interface round-trip delay of the parsing interface.

[0011] Furthermore, the calculation of the resolution throughput of each resolution interface based on the resolution time corresponding to the item code resolved by each resolution interface specifically includes: obtaining the resolution time corresponding to the item code resolved by each resolution interface, calculating the average value of all resolution times corresponding to each resolution interface as the average resolution time of each resolution interface; calculating the ratio of unit time to the average resolution time to obtain the number of resolutions of each resolution interface per unit time, and taking the number of resolutions of each resolution interface per unit time as the resolution throughput of each resolution interface.

[0012] Furthermore, based on the resolution throughput and the interface round-trip delay of each resolution interface among the multiple resolution interfaces, a resolution interface that meets the requirements is determined among the multiple resolution interfaces, specifically including: calculating the ratio of unit time to the resolution throughput of each resolution interface, adding the ratio and the interface round-trip delay to obtain the interface resolution parameter of each resolution interface; sorting the multiple resolution interfaces according to the size of the interface resolution parameters; judging the resolution status of the first resolution interface, and if the first resolution interface is in the interface idle state, selecting the first resolution interface as the resolution interface that meets the requirements.

[0013] Furthermore, after completing the parsing of the current item code through the code parsing interface, the method further includes: obtaining the moment when the code parsing interface receives the parsing request for the current item code as a third moment, and obtaining the moment when the code parsing interface returns the request processing result as a fourth moment; calculating the time difference between the fourth moment and the third moment as the current round-trip delay of the code parsing interface; if the current round-trip delay is inconsistent with the interface round-trip delay, using the current round-trip delay as the round-trip delay of the code parsing interface to update the round-trip delay of the code parsing interface.

[0014] Furthermore, completing the parsing of the current item code through the code parsing interface specifically includes: receiving a parsing request for the current item code, wherein the parsing request includes the preset second coding rule; obtaining, according to the preset second coding rule, a parsing rule of the code parsing interface corresponding to the preset second coding rule; calling the code parsing interface, parsing the current item code through the parsing rule of the code parsing interface, and obtaining the data to be parsed corresponding to the item code.

[0015] One or more embodiments of this specification provide an item code parsing device, including:

[0016] at least one processor; and,

[0017] a memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:

[0019] Obtaining item coding data to be parsed, wherein the item coding data includes a coding rule identification code and an item code; determining a first coding rule for the item code based on the coding rule identification code; re-encoding the item code of the first coding rule based on a preset second coding rule to obtain a current item code; calling a pre-stored mapping table of coding rules and coding parsing interfaces; determining a coding parsing interface for the current item code based on the second coding rule and the mapping table; and completing parsing of the current item code through the coding parsing interface.

[0020] One or more embodiments of this specification provide a non-volatile computer storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to:

[0021] Obtaining item coding data to be parsed, wherein the item coding data includes a coding rule identification code and an item code; determining a first coding rule for the item code based on the coding rule identification code; re-encoding the item code of the first coding rule based on a preset second coding rule to obtain a current item code; calling a pre-stored mapping table of coding rules and coding parsing interfaces; determining a coding parsing interface for the current item code based on the second coding rule and the mapping table; and completing parsing of the current item code through the coding parsing interface.

[0022] At least one of the above-mentioned technical solutions adopted in the embodiments of this specification can achieve the following beneficial effects: by setting a coding rule identification code, the coding rule of the item code is added to the item code data, and according to the different coding rules corresponding to the item code, the corresponding second coding rule is selected to re-encode the item code and convert it into a coding form that can be converted by the current interface; through the relationship between the parsing coding types corresponding to different parsing interfaces in the pre-constructed mapping table, the parsing interface that can parse the current item code is determined, and through the form conversion, the parsing interface is enabled to parse object codes of different forms and types, and the parsing interface can obtain correct parsing results. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the following briefly introduces the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are only some of the embodiments described in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without inventive work. In the drawings:

[0024] Figure 1 A flowchart of a method for parsing an item code provided in an embodiment of this specification;

[0025] Figure 2 A schematic diagram of the structure of an item code parsing device provided in an embodiment of this specification. DETAILED DESCRIPTION

[0026] To help those skilled in the art better understand the technical solutions in this specification, the following will provide a clear and complete description of the technical solutions in the embodiments of this specification, in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this specification without creative work should fall within the scope of protection of this specification.

[0027] The Industrial Internet identity resolution system consists of identity resolution nodes and recursive resolution nodes. Identity resolution nodes include national top-level nodes, second-level nodes, and enterprise nodes. Each identity resolution node, with different priorities, may correspond to multiple resolution servers. The IP address and port number of each resolution server constitute a resolution interface for that resolution server.

[0028] Different parsing interfaces correspond to different parsing rules. Under different parsing rules, different parsing interfaces can parse different types of item codes. Existing techniques for parsing item codes use a method of randomly assigning parsing ports. However, due to inconsistencies between the encoding rules of different item codes and the parsing interface's parsing rules, item codes may not be parsed.

[0029] The embodiment of this specification provides a method for parsing an item code. It should be noted that the execution subject in the embodiment of this specification can be a server or any processing device with data processing capabilities. Figure 1 This is a method for parsing an item code provided in the embodiment of this specification, such as Figure 1 As shown, the method mainly includes the following steps:

[0030] Step S101: Obtain the item code data to be parsed.

[0031] The same item code does not necessarily correspond to the same item. For example, ucode and mFRIDcode both have 128-bit encoding types, and cannot be correctly parsed based on the item code alone.

[0032] In one embodiment of the present specification, a parsing request for item code data is received and the correctness of the parsing request is determined. Generally speaking, a correct parsing request should include both the item code and the rule code identification code. Upon receiving a parsing request for item code data, the parsing request is analyzed. If the parsing request only includes the item code, it is considered an incorrect parsing request and no processing is performed on the parsing request. If the item code data in the parsing request consists of the rule code identification code and the item code, the parsing request is determined to be correct and the item code data in the parsing request is treated as the item code data to be parsed.

[0033] In one embodiment of this specification, item code data includes a coding rule identification code and an item code. To avoid the problem of identical item codes not necessarily corresponding to identical items, resulting in incorrect parsing based solely on the item code, a coding rule identification code is included in the item code data. It should be noted that the coding rule identification code represents the coding rule for the item code. Each identification code has a reserved object identifier space for storing the corresponding coding rule identification code. The coding rule identification code contains information about the coding standard used for the item code, specifically the type of coding standard.

[0034] Step S102: determining a first coding rule for the item coding according to the coding rule identification code.

[0035] In one embodiment of the present specification, the encoding rule of the item code in the item code data to be parsed is determined based on the acquired encoding rule identification code, that is, the first encoding rule of the item code.

[0036] Step S103: re-encode the item code of the first encoding rule according to the preset second encoding rule to obtain the current item code.

[0037] In actual application scenarios, the parsing interface may parse item codes of different types or formats. To avoid parsing errors caused by different code types or formats, the item codes in the item code data to be parsed are converted so that the format of the item codes meets the parsing format of the parsing interface.

[0038] In one embodiment of this specification, a second encoding rule is pre-set based on the different formats of item codes that can be parsed by different parsing interfaces. It should be noted that in order to convert the item code into a format that can be parsed by the parsing interface, the encoding rule for the item code must first be determined. Specifically, after determining the first encoding rule for the item code using the encoding rule identification code, a second encoding rule corresponding to the first encoding rule is selected to re-encode the item code to obtain the current item code.

[0039] Step S104: calling a pre-stored mapping table of encoding rules and encoding parsing interfaces.

[0040] In one embodiment of the present specification, historical resolution codes of multiple resolution interfaces are obtained in advance; the multiple historical resolution codes are re-encoded according to the encoding rules in the historical resolution codes to obtain multiple specified type codes. It should be noted that the specified type code is a coding form that can be parsed by multiple resolution interfaces. Different interface identifiers are set for multiple resolution interfaces, and according to the specified type code corresponding to each resolution interface, a mapping relationship between the resolution interface identifier and the multiple specified type codes is constructed and stored in a mapping table.

[0041] Step S105: Determine the code parsing interface for the current item code based on the second coding rule and the mapping table; and complete the parsing of the current item code through the code parsing interface.

[0042] In one embodiment of the present specification, the item code in the item code data to be parsed is converted into a current item code that can be parsed by the parsing interface. It should be noted that the current item code here is a coding format that can be parsed by the parsing interface. Since each parsing interface corresponds to a different type of parsable code, it is also necessary to use a mapping table to find multiple interfaces of the coding type that can parse the current item code.

[0043] In one embodiment of the present specification, a designated type code is determined in a mapping table based on the encoding type of the current item code, where the designated type code is the same as the encoding type of the current item code. Based on the designated type code having the same encoding type as the current item code and the mapping relationship between the parsing interface identifier and the multiple designated type codes, multiple parsing interfaces corresponding to the designated type codes are determined. The multiple parsing interfaces determined herein are interfaces that can parse the types corresponding to the current item code.

[0044] In the prior art, after receiving an identity resolution request, a recursive resolution node typically randomly calls the resolution service node's resolution interface to process the identity resolution request and obtain the identity resolution information. This fails to ensure load balancing across the resolution interfaces, easily causing a single resolution interface to be overloaded. Furthermore, the randomly selected interface may result in low resolution efficiency.

[0045] In one embodiment of the present disclosure, historical parsing data for multiple parsing interfaces is obtained. This historical parsing data includes the parsing time required by each parsing interface to parse each item code, as well as the round-trip latency of each parsing interface during the historical parsing process. The parsing records for each parsing interface are used to obtain multiple historical item codes that have been parsed by each parsing interface. It should be noted that the historical item codes here represent those that have been successfully parsed. The parsing records include the time when the parsing request for each historical item code was received, as well as the time when the parsing interface returned the result of the request.

[0046] The time difference between a first moment and a second moment is calculated, and the resulting time difference is used as the round-trip delay for the parsing interface to parse the corresponding historical item code. The first moment is the moment the parsing request for each historical item code is received, and the second moment is the moment the parsing interface returns the result of the request. Multiple round-trip delays for multiple historical item codes parsed by the parsing interface are calculated, and the average of these round-trip delays is calculated as the parsing interface's round-trip delay. This yields historical parsing data for the parsing interface.

[0047] In one embodiment of the present specification, the resolution throughput of each resolution interface is calculated based on the resolution time corresponding to the item code resolved by each resolution interface, where the resolution throughput is the number of resolutions per second for each resolution interface. This specifically includes: obtaining the resolution time corresponding to the item code resolved by each resolution interface, calculating the average of all resolution times corresponding to each resolution interface as the average resolution time for each resolution interface; calculating the ratio of the unit time to the average resolution time to obtain the number of resolutions per resolution interface per unit time, and using the number of resolutions per resolution interface per unit time as the resolution throughput for each resolution interface. It should be noted that the unit time here can be per second.

[0048] For example, the current parsing interface takes 5 microseconds to parse the code of item A, 6 microseconds to parse the code of item B, and 4 microseconds to parse the code of item C. The average of the three times is 5 microseconds, which is the average parsing time of the current parsing interface. The ratio of 1 second to 5 microseconds is 200,000 times, so the parsing throughput of the current parsing interface is 200,000 times.

[0049] In one embodiment of the present specification, a resolution interface that meets the requirements is determined from among multiple resolution interfaces based on the resolution throughput and round-trip latency of each resolution interface. Specifically, the method includes: calculating the ratio of the unit time to the resolution throughput of each resolution interface, summing the ratio with the round-trip latency to obtain an interface resolution parameter for each resolution interface; sorting the multiple resolution interfaces according to the size of the interface resolution parameters; and determining the resolution status of the top resolution interface. If the top resolution interface is in an idle state, the top resolution interface is selected as the resolution interface that meets the requirements.

[0050] That is to say, calculate the ratio of the unit time to the resolution throughput of each resolution interface, add the ratio and the interface round-trip delay, and obtain the interface resolution parameter of each resolution interface. The interface resolution parameter here combines the throughput and resolution round-trip delay of the resolution interface to obtain the quantitative parameter of the interface capability of the resolution interface. Sort the multiple resolution interfaces according to the size of the interface resolution parameters. The sorting here can be from low to high. The lower the interface resolution parameter, the stronger the resolution capability of the interface. Determine the resolution status of the first resolution interface. If the first resolution interface is in the interface idle state, select the first resolution interface as the resolution interface that meets the requirements. If the first resolution interface is in the resolution state, determine the interface status of the second resolution interface, and so on until a resolution interface that meets the requirements is obtained.

[0051] In one embodiment of the present specification, based on the resolution throughput and resolution round-trip delay of each resolution interface, a resolution interface that meets the requirements is determined, and the resolution throughput can also be sorted, and a throughput threshold can be set. The resolution interfaces that are lower than the throughput threshold are excluded, and the remaining resolution interfaces are sorted according to the resolution round-trip delay. The first resolution interface is selected, and it is determined whether the selected resolution interface is in the interface idle state. If the first resolution interface is in the interface idle state, the first resolution interface is selected. If the interface state of the first resolution interface is the resolution state, the second resolution interface is judged, and so on until a resolution interface that meets the requirements is selected.

[0052] In one embodiment of the present specification, after obtaining a parsing interface that meets the requirements, the current item code is parsed through the parsing interface to obtain a parsing result. First, a parsing request for the current item code is received, wherein the parsing request includes a pre-set second encoding rule. Thereafter, according to the pre-set second encoding rule, the parsing rule of the encoding parsing interface corresponding to the pre-set second encoding rule is obtained. It should be noted that in addition to setting the second rule code in the parsing request, the decoding rule corresponding to the second encoding rule can also be saved when setting the second encoding rule and stored in the storage interface. When the parsing request is received and the encoding parsing interface is called for parsing, the decoding rule is first called through the storage interface to determine the parsing rule of the encoding parsing interface corresponding to the second encoding rule. After obtaining the parsing rule, the encoding parsing interface is called to parse the current item code through the parsing rule of the encoding parsing interface to obtain the data to be parsed corresponding to the item code.

[0053] After the code parsing interface completes parsing the current item code, the parsing information for the current item code can also be parsed using the code parsing interface. The code parsing interface is updated based on the round-trip delay. The time when the code parsing interface receives the parsing request for the current item code is obtained as the third moment. The time when the code parsing interface returns the request processing result is obtained as the fourth moment.

[0054] The time period corresponding to the third moment and the fourth moment is used as the round-trip delay for parsing the current item code. That is, the time difference between the fourth moment and the third moment is calculated as the current round-trip delay of the code parsing interface. Determine whether the current round-trip delay is consistent with the interface round-trip delay of this parsing interface. If the two are consistent, no change is required. If the current round-trip delay is inconsistent with the interface round-trip delay, the current round-trip delay is used to replace the interface round-trip delay, and the current round-trip delay is used as the round-trip delay of the code parsing interface to update the round-trip delay of the code parsing interface. When the user selects the code parsing interface next time, the selection is based on the updated round-trip delay.

[0055] By setting the coding rule identification code, the coding rule of the item code is added to the item coding data. According to the different coding rules corresponding to the item code, the corresponding second coding rule is selected to re-encode the item code and convert it into a coding form that can be converted by the current interface; through the relationship between the parsing coding types corresponding to different parsing interfaces in the pre-constructed mapping table, the parsing interface that can parse the current item code is determined. Through form conversion, the parsing interface is able to parse object codes of different forms and types, and the parsing interface can obtain correct parsing results.

[0056] The embodiment of this specification also provides an article code parsing device, such as Figure 2As shown, the device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can: obtain item coding data to be parsed, wherein the item coding data includes a coding rule identification code and an item code; determine a first coding rule for the item code according to the coding rule identification code; re-encode the item code of the first coding rule according to a preset second coding rule to obtain a current item code; call a pre-stored mapping table of coding rules and coding parsing interfaces; determine a coding parsing interface for the current item code according to the second coding rule and the mapping table; and complete the parsing of the current item code through the coding parsing interface. An embodiment of the present specification further provides a non-volatile computer storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to: obtain item coding data to be parsed, wherein the item coding data includes a coding rule identification code and an item code; determine a first coding rule for the item code based on the coding rule identification code; recode the item code of the first coding rule based on a pre-set second coding rule to obtain a current item code; call a pre-stored mapping table of coding rules and coding parsing interfaces; determine a coding parsing interface for the current item code based on the second coding rule and the mapping table; and complete parsing of the current item code through the coding parsing interface.

[0057] The various embodiments in this specification are described in a progressive manner. Similar portions between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the device, apparatus, and non-volatile computer storage medium embodiments are generally similar to the method embodiments, so their descriptions are relatively simplified. For relevant details, refer to the descriptions of the method embodiments.

[0058] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0059] The foregoing description is merely one or more embodiments of this specification and is not intended to limit this specification. It will be apparent to those skilled in the art that various modifications and variations may be made to one or more embodiments of this specification. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of one or more embodiments of this specification are intended to be within the scope of the claims of this specification.

Claims

1. A method for parsing an article code, characterized in that: The method comprises: Obtaining item coding data to be parsed, wherein the item coding data includes a coding rule identification code and an item code; Determining a first coding rule for the item coding according to the coding rule identification code; Re-encoding the item code of the first encoding rule according to a preset second encoding rule to obtain a current item code; Calling the pre-stored mapping table of encoding rules and encoding parsing interface; Determining a code parsing interface for the current item code according to the second coding rule and the mapping table; Complete the parsing of the current item code through the code parsing interface; Before calling the pre-stored mapping table of encoding rules and encoding parsing interface, it also includes: Pre-acquire historical parsing codes of multiple parsing interfaces; Re-encode the multiple historical parsing codes according to the encoding rules in the historical parsing codes to obtain multiple codes of specified types; Constructing a mapping relationship between the parsing interface identifier and a plurality of specified type codes, and storing the mapping relationship in the mapping table; The code parsing interface for determining the current item code according to the mapping table specifically includes: According to the encoding type of the current item code, determining in the mapping table a designated type code having the same encoding type as the current item code; Determining, based on a designated type code that is the same as the code type of the current item code and a mapping relationship between a resolution interface identifier and multiple designated type codes, multiple resolution interfaces corresponding to the designated type codes; Obtaining historical parsing data of the multiple parsing interfaces, wherein the historical parsing data includes the parsing time required for each parsing interface to parse each item code, and the interface round-trip delay during the historical parsing process of each parsing interface; Calculate the parsing throughput of each parsing interface based on the parsing time corresponding to the item code parsed by each parsing interface, wherein the parsing throughput is the number of parsing times per second of each parsing interface; According to the resolution throughput and the round-trip delay of each resolution interface among the multiple resolution interfaces, a resolution interface that meets the requirements is determined among the multiple resolution interfaces.

2. The method for parsing an article code according to claim 1, characterized in that: The acquiring of historical parsing data of the multiple parsing interfaces specifically includes: Obtaining, through the parsing records of each parsing interface, a plurality of historical item codes parsed by each parsing interface, wherein the parsing records include the time when a parsing request for each historical item code was received and the time when the parsing interface returned a request processing result; Calculating the time difference between a first moment and a second moment, and using the time difference as the round-trip delay for the parsing interface to parse the historical item code, wherein the first moment is the moment when a parsing request for each historical item code is received, and the second moment is the moment when the parsing interface returns a request processing result; A plurality of round trip delays of the parsing interface for parsing the plurality of historical item codes is calculated, and an average value of the plurality of round trip delays is calculated as the interface round trip delay of the parsing interface.

3. The method for parsing an article code according to claim 1, characterized in that: Calculating the parsing throughput of each parsing interface according to the parsing time corresponding to the item code parsed by each parsing interface specifically includes: Obtaining the parsing time corresponding to the item code parsed by each parsing interface, and calculating the average of all parsing times corresponding to each parsing interface as the average parsing time of each parsing interface; The ratio of the unit time to the average resolution time is calculated to obtain the number of resolutions of each resolution interface within the unit time, and the number of resolutions of each resolution interface within the unit time is used as the resolution throughput of each resolution interface.

4. The method for parsing an article code according to claim 1, wherein: Determining a resolution interface that meets the requirements from among the multiple resolution interfaces based on the resolution throughput and the round-trip delay of each resolution interface includes: Calculating a ratio of a unit time to a resolution throughput of each resolution interface, and summing the ratio and the interface round-trip delay to obtain an interface resolution parameter of each resolution interface; Sort the multiple parsing interfaces according to the size of the interface parsing parameters; The parsing state of the parsing interface located at the first position is determined. If the parsing interface at the first position is in the interface idle state, the parsing interface at the first position is selected as the parsing interface that meets the requirements.

5. The method for parsing an article code according to claim 1, wherein: After completing the parsing of the current item code through the code parsing interface, the method further includes: Obtaining the time when the code parsing interface receives the parsing request for the current item code as the third time, and obtaining the time when the code parsing interface returns the request processing result as the fourth time; Calculating a time difference between the fourth moment and the third moment as a current round-trip delay of the encoding parsing interface; If the current round-trip delay is inconsistent with the interface round-trip delay, the current round-trip delay is used as the round-trip delay of the encoding and parsing interface to update the round-trip delay of the encoding and parsing interface.

6. The method for parsing an article code according to claim 1, wherein: The parsing of the current item code through the code parsing interface specifically includes: receiving a parsing request for the current item code, wherein the parsing request includes the preset second encoding rule; According to the preset second encoding rule in the parsing request, obtaining a parsing rule of the encoding parsing interface corresponding to the preset second encoding rule; The code parsing interface is called, and the current item code is parsed according to the parsing rules of the code parsing interface to obtain the data to be parsed corresponding to the item code.

7. An article code analysis device, characterized in that: The device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: Obtaining item coding data to be parsed, wherein the item coding data includes a coding rule identification code and an item code; Determining a first coding rule for the item coding according to the coding rule identification code; Re-encoding the item code of the first encoding rule according to a preset second encoding rule to obtain a current item code; Calling the pre-stored mapping table of encoding rules and encoding parsing interface; Determining a code parsing interface for the current item code according to the second coding rule and the mapping table; Complete the parsing of the current item code through the code parsing interface; Before calling the pre-stored mapping table of encoding rules and encoding parsing interface, it also includes: Pre-acquire historical parsing codes of multiple parsing interfaces; Re-encode the multiple historical parsing codes according to the encoding rules in the historical parsing codes to obtain multiple codes of specified types; Constructing a mapping relationship between the parsing interface identifier and a plurality of specified type codes, and storing the mapping relationship in the mapping table; The code parsing interface for determining the current item code according to the mapping table specifically includes: According to the encoding type of the current item code, determining in the mapping table a designated type code having the same encoding type as the current item code; Determining, based on a designated type code that is the same as the code type of the current item code and a mapping relationship between a resolution interface identifier and multiple designated type codes, multiple resolution interfaces corresponding to the designated type codes; Obtaining historical parsing data of the multiple parsing interfaces, wherein the historical parsing data includes the parsing time required for each parsing interface to parse each item code, and the interface round-trip delay during the historical parsing process of each parsing interface; Calculate the parsing throughput of each parsing interface based on the parsing time corresponding to the item code parsed by each parsing interface, wherein the parsing throughput is the number of parsing times per second of each parsing interface; According to the resolution throughput and the round-trip delay of each resolution interface among the multiple resolution interfaces, a resolution interface that meets the requirements is determined among the multiple resolution interfaces.

8. A non-volatile computer storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to: Get the item code data to be parsed, where: The item coding data includes a coding rule identification code and an item code; Determining a first coding rule for the item coding according to the coding rule identification code; Re-encoding the item code of the first encoding rule according to a preset second encoding rule to obtain a current item code; Calling the pre-stored mapping table of encoding rules and encoding parsing interface; Determining a code parsing interface for the current item code according to the second coding rule and the mapping table; Complete the parsing of the current item code through the code parsing interface; Before calling the pre-stored mapping table of encoding rules and encoding parsing interface, it also includes: Pre-acquire historical parsing codes of multiple parsing interfaces; Re-encode the multiple historical parsing codes according to the encoding rules in the historical parsing codes to obtain multiple codes of specified types; Constructing a mapping relationship between the parsing interface identifier and a plurality of specified type codes, and storing the mapping relationship in the mapping table; The code parsing interface for determining the current item code according to the mapping table specifically includes: According to the encoding type of the current item code, determining in the mapping table a designated type code having the same encoding type as the current item code; Determining, based on a designated type code that is the same as the code type of the current item code and a mapping relationship between a resolution interface identifier and multiple designated type codes, multiple resolution interfaces corresponding to the designated type codes; Obtaining historical parsing data of the multiple parsing interfaces, wherein the historical parsing data includes the parsing time required for each parsing interface to parse each item code, and the interface round-trip delay during the historical parsing process of each parsing interface; Calculate the parsing throughput of each parsing interface based on the parsing time corresponding to the item code parsed by each parsing interface, wherein the parsing throughput is the number of parsing times per second of each parsing interface; According to the resolution throughput and the round-trip delay of each resolution interface among the multiple resolution interfaces, a resolution interface that meets the requirements is determined among the multiple resolution interfaces.

Citation Information

Patent Citations

  • Addressing method and system for internet of things

    CN101751432A

Cited By

  • Material code automatic mapping and conversion method of cross-coding system

    CN121637090A