Commodity code synchronization method and device, equipment and storage medium
By obtaining the product code pairs of the upstream system and updating the coding mapping table, the problem of code mismatch between the upstream and downstream systems is solved and the normal operation and data consistency of the system are ensured.
Patent Information
- Application Number
- CN202410886019.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2024-08-23
AI Technical Summary
The product codes do not correspond between the upstream and downstream systems, causing confusion in system operations and affecting normal operations.
By obtaining the product code pairs from the upstream system, the coding mapping table is determined, and the mapping relationship is determined. If it exists, it is updated synchronously. If not, the mapping relationship is added to the coding mapping table to ensure coding consistency.
It achieves the correspondence and consistency of upstream and downstream system codes, ensures the normal operation of the system, and avoids mishandling and errors caused by mismatched codes.
Smart Images

Figure CN118535649A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of commodity code synchronization, and in particular to a commodity code synchronization method, device, equipment and storage medium. Background Art
[0002] Product information is very important data in e-commerce. With the continuous expansion of business and rapid upgrade of systems, many problems will also emerge. One common problem is the mismatch of product codes. Normally, for the same type / same product, the code of the upstream system and the code of the downstream system are different but corresponding. For example, the upstream system codes product A as code 1, and the downstream system codes product A as code 2. Code 1 and code 2 are corresponding.
[0003] Since the upstream system will first update the changes in product information, if the code of product A changes, code 1 will also change. If code 2 is not updated in time to correspond to the changed code of code 1, it will cause confusion in the correspondence between the upstream and downstream systems regarding the products, affecting the normal operation of the upstream and downstream systems. Summary of the invention
[0004] In view of this, the present application provides a product coding synchronization method, device, equipment and storage medium, which are used to ensure the consistency and correspondence of product coding between upstream and downstream systems, and ensure the normal operation of upstream and downstream systems.
[0005] To achieve the above objectives, the proposed solution is as follows:
[0006] In a first aspect, a commodity code synchronization method includes:
[0007] Obtain each upstream commodity code pair of the upstream system; wherein the upstream commodity code pair consists of a first commodity code and a second commodity code, wherein the first commodity code indicates the code corresponding to the commodity in the upstream system, and the second commodity code indicates the code corresponding to the commodity in the downstream system;
[0008] Determine a coding mapping table in a downstream system corresponding to the upstream system;
[0009] For each of the upstream commodity code pairs, determining whether there is a mapping relationship corresponding to the first commodity code or the second commodity code in the upstream commodity code pair in the code mapping table;
[0010] If yes, then the mapping relationship is synchronously updated using the first commodity code or the second commodity code in the upstream commodity code pair;
[0011] If not, the upstream commodity code pair is converted into a mapping relationship and added to the code mapping table.
[0012] Preferably, the synchronously updating the mapping relationship by using the first commodity code or the second commodity code in the upstream commodity code pair includes:
[0013] If there is a mapping relationship corresponding to the first commodity code in the upstream commodity code pair in the code mapping table, determining whether the commodity code corresponding to the first commodity code in the mapping relationship is the same as the second commodity code in the upstream commodity code pair;
[0014] If not, the commodity code corresponding to the first commodity code in the mapping relationship is changed to the second commodity code in the upstream commodity code pair.
[0015] Preferably, the synchronously updating the mapping relationship by using the first commodity code or the second commodity code in the upstream commodity code pair includes:
[0016] If there is a mapping relationship corresponding to the second commodity code in the upstream commodity code pair in the code mapping table, determining whether the commodity code corresponding to the second commodity code in the mapping relationship is the same as the first commodity code in the upstream commodity code pair;
[0017] If not, the commodity code corresponding to the second commodity code in the mapping relationship is changed to the first commodity code in the upstream commodity code pair.
[0018] Preferably, it also includes:
[0019] Determine the target product corresponding to the upstream product code pair;
[0020] All basic product information of the target product is obtained, and the product information of the target product stored in the downstream system is updated using the basic product information.
[0021] Preferably, the adding the upstream commodity code pair as a mapping relationship to the code mapping table includes:
[0022] Determine the target product corresponding to the upstream product code pair;
[0023] Determine the classification of each level to which the target commodity belongs from a preset commodity level classification table;
[0024] Determine the minimum level classification to which the target product belongs as the target classification;
[0025] The upstream commodity code pair is added to the code mapping table as a mapping relationship using the target classification.
[0026] Preferably, the step of adding the upstream commodity code pair as a mapping relationship to the code mapping table by using the target classification includes:
[0027] Determine whether, among the mapping relationships in the coding mapping table, there is one or more mapping relationships that contain the target classification in the classifications of the corresponding levels of the commodity;
[0028] If yes, convert the upstream commodity code pair into a mapping relationship, and add it after one or more mapping relationships containing the target classification in the classification of each level to which the corresponding commodity belongs;
[0029] If not, then in each level of classification to which the target product belongs, the classification of the previous level of the target classification will be used as the new target classification, and the step of determining whether there are one or more mapping relationships of the target classification in the classifications of each level to which the corresponding product belongs in each mapping relationship in the coding mapping table, until the classifications of each level to which the product belongs corresponding to each mapping relationship in the coding mapping table do not contain any level of classification to which the target product belongs, then the upstream product code pair will be added as a mapping relationship after the last mapping relationship in the coding mapping table.
[0030] Preferably, the determining of the encoding mapping table in the downstream system corresponding to the upstream system comprises:
[0031] Obtaining source information uniformly corresponding to each of the upstream commodity code pairs;
[0032] Determine flow direction information according to the source information;
[0033] Determining a downstream system corresponding to the upstream system based on the flow direction information;
[0034] Extracting the message type of each upstream commodity code pair;
[0035] According to the message type, a coding mapping table is obtained from the downstream system.
[0036] In a second aspect, a commodity code synchronization device includes:
[0037] An upstream commodity code pair acquisition module is used to acquire each upstream commodity code pair of the upstream system; wherein the upstream commodity code pair is composed of a first commodity code and a second commodity code, wherein the first commodity code indicates the code corresponding to the commodity in the upstream system, and the second commodity code indicates the code corresponding to the commodity in the downstream system;
[0038] A coding mapping table determination module, used to determine a coding mapping table in a downstream system corresponding to the upstream system;
[0039] A determination module, configured to determine, for each upstream commodity code pair, whether there is a mapping relationship corresponding to the first commodity code or the second commodity code in the upstream commodity code pair in the code mapping table;
[0040] a synchronous updating module, configured to synchronously update the mapping relationship by using the first commodity code or the second commodity code in the upstream commodity code pair if yes;
[0041] The adding module is used to add the upstream commodity code pair as a mapping relationship to the code mapping table if not.
[0042] In a third aspect, a commodity code synchronization device includes a memory and a processor;
[0043] The memory is used to store programs;
[0044] The processor is used to execute the program to implement each step of the commodity code synchronization method as described in any one of the first aspects.
[0045] In a fourth aspect, a storage medium stores a computer program thereon, and when the computer program is executed by a processor, the steps of the commodity code synchronization method as described in any one of the first aspects are implemented.
[0046] It can be seen from the above technical solution that the present application obtains each upstream commodity code pair of the upstream system; wherein the upstream commodity code pair is composed of a first commodity code and a second commodity code, the first commodity code represents the code corresponding to the commodity in the upstream system, and the second commodity code represents the code corresponding to the commodity in the downstream system; determines the code mapping table in the downstream system corresponding to the upstream system; for each of the upstream commodity code pairs, determines whether there is a mapping relationship corresponding to the first commodity code or the second commodity code in the upstream commodity code pair in the code mapping table; if so, uses the first commodity code or the second commodity code in the upstream commodity code pair to synchronously update the mapping relationship; if not, converts the upstream commodity code pair into a mapping relationship and adds it to the code mapping table. This solution obtains an upstream commodity code pair about the commodity code of the upstream system, and the upstream commodity code pair is composed of a first commodity code and a second commodity code, wherein the first commodity code indicates the code corresponding to the commodity in the upstream system, and the second commodity code indicates the code corresponding to the commodity in the downstream system, that is, from the upstream commodity code pair, it can be seen that the code recorded in the upstream system and the code recorded in the downstream system are the same as the upstream commodity code pair. If the upstream system and the downstream system are corresponding, the mapping relationship in the code mapping table of the downstream system is a one-to-one correspondence with the upstream commodity code pair, so each upstream commodity code pair is compared with the code mapping table of the downstream system to determine whether there is a mismatch between the first commodity code and the second commodity code in the code mapping table. The mismatch may be that any one of the first commodity code or the second commodity code does not correspond to the code in the code mapping table, or that the upstream system has added a commodity, so there is no corresponding code mapping relationship in the downstream system at all, so the code mapping table is updated according to different situations to ensure the correspondence and consistency of the codes of the upstream and downstream systems and the normal operation of the upstream and downstream systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0048] Figure 1 An optional flow chart of a commodity code synchronization method provided in an embodiment of the present application;
[0049] Figure 2 A schematic diagram of the structure of a commodity code synchronization device provided in an embodiment of the present application;
[0050] Figure 3 A schematic diagram of the structure of a commodity code synchronization device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0052] Product information is very important data in e-commerce. With the continuous expansion of business and rapid upgrade of systems, many problems will also emerge. One common problem is the mismatch of product codes. Normally, for the same type / same product, the code of the upstream system and the code of the downstream system are different but corresponding. For example, the upstream system codes product A as code 1, and the downstream system codes product A as code 2. Code 1 and code 2 are corresponding.
[0053] Since the upstream system will first update the changes in product information, if the code of product A changes, code 1 will also change. If code 2 is not updated in time to correspond to the changed code of code 1, it will cause confusion in the correspondence between the upstream and downstream systems about the products, affecting the normal operation of the upstream and downstream systems. For example, the upstream system needs to process a product, and the downstream system performs the same processing on the corresponding product according to the corresponding code. However, since the upstream and downstream systems may not have corresponding coding information for the same product, the downstream system may mistakenly process other products, causing errors.
[0054] In order to solve the defects of the above-mentioned prior art, an embodiment of the present invention provides a method for synchronizing commodity codes, which can be applied to various computer terminals or smart terminals, and its execution subject can be a processor or server of the computer terminal or smart terminal. The method flow chart of the method is as follows: Figure 1 As shown, specifically including:
[0055] S1: Obtain each upstream commodity code pair of the upstream system; wherein the upstream commodity code pair consists of a first commodity code and a second commodity code, wherein the first commodity code represents the code corresponding to the commodity in the upstream system, and the second commodity code represents the code corresponding to the commodity in the downstream system.
[0056] The commodity coding synchronization method provided in the present application can be used periodically or in real time to realize the coding correspondence between the upstream system and the downstream system. The upstream system defines each upstream commodity coding pair. One commodity corresponds to one or more upstream commodity coding pairs, or it can also be considered that one commodity corresponds to one or more upstream commodity coding pairs. The upstream commodity coding pair consists of a first commodity code and a second commodity code. The upstream commodity coding pair is in the form of "first commodity code-second commodity code". Among them, the first commodity code can be considered as the coding name of the commodity in the upstream system, and the second commodity code can be considered as the coding name of the commodity in the downstream system. For example, for a commodity A, the upstream system's code for commodity A is 123, and the downstream system's code for commodity A is 456. The upstream commodity coding pair is 123-456, and the coding relationship for commodity A in the downstream system is expressed as 456-123.
[0057] S2: Determine a coding mapping table in a downstream system corresponding to the upstream system.
[0058] The code mapping table in the downstream system defines many mapping relationships between upstream system codes and downstream system codes. If the upstream system and the downstream system have corresponding code definitions for each type / each product, the mapping relationship in the code mapping table is in the form of "second product code-first product code". An optional code mapping table is shown in Table 1 below:
[0059] Table 1
[0060]
[0061] If the code mapping table represented by Table 1 corresponds to the upstream commodity code pair of the upstream system, then 456, 789 and 667 are all second commodity codes, and 123, 987 and 446 are all first commodity codes.
[0062] Therefore, it is possible to determine whether the commodity codes in the upstream system and the downstream system correspond based on the upstream commodity code pair and the code mapping table.
[0063] S3: For each of the upstream commodity code pairs, determine whether there is a mapping relationship corresponding to the first commodity code or the second commodity code in the upstream commodity code pair in the code mapping table.
[0064] In one case, for a commodity, the first commodity code of the commodity is 123a, and there may be two suppliers for the commodity, so the second commodity code of the commodity may be two, namely, 456a and 456b. Therefore, the upstream commodity code pairs corresponding to the commodity are: 123a-456a and 123a-456b, and the corresponding mapping relationships of the downstream system are: 456a-123a and 456b-123a. In order to make the data management of the upstream system more convenient, the upstream system will change the upstream commodity code pair 123a-456b to 123b-456b. Therefore, there is no mapping relationship corresponding to 123b-456b in the downstream system, but 456b is the same. At this time, it can be considered that there is a mapping relationship 456b-123a corresponding to the first commodity code 456b in the code mapping table.
[0065] In another case, for a product, the upstream product code pair of the product is 987-789, and there is no code in any mapping relationship in the downstream system's code mapping table that is the same as 987 or 789, that is, there is no mapping relationship corresponding to the first product code or the second product code in the upstream product code pair in the code mapping table, then it can be considered that this upstream system code pair is newly added by the upstream system.
[0066] S4: If yes, then use the first commodity code or the second commodity code in the upstream commodity code pair to synchronously update the mapping relationship.
[0067] If there is a mapping relationship corresponding to the first product code or the second product code in the upstream product code pair in the code mapping table, then the mapping relationship can be synchronously updated using the first product code or the second product code in the upstream product code pair.
[0068] S5: If not, then add the upstream commodity code pair as a mapping relationship to the code mapping table.
[0069] If there is no mapping relationship corresponding to the first product code or the second product code in the upstream product code pair in the code mapping table, it means that the product corresponding to the upstream product code pair is newly added in the upstream system. In order to maintain the unity of upstream and downstream, the upstream product code pair needs to be converted into a mapping relationship and added to the code mapping table.
[0070] It can be seen from the above technical solution that the present application obtains each upstream commodity code pair of the upstream system; wherein the upstream commodity code pair is composed of a first commodity code and a second commodity code, the first commodity code represents the code corresponding to the commodity in the upstream system, and the second commodity code represents the code corresponding to the commodity in the downstream system; determines the code mapping table in the downstream system corresponding to the upstream system; for each of the upstream commodity code pairs, determines whether there is a mapping relationship corresponding to the first commodity code or the second commodity code in the upstream commodity code pair in the code mapping table; if so, uses the first commodity code or the second commodity code in the upstream commodity code pair to synchronously update the mapping relationship; if not, converts the upstream commodity code pair into a mapping relationship and adds it to the code mapping table. This solution obtains an upstream commodity code pair about the commodity code of the upstream system, and the upstream commodity code pair is composed of a first commodity code and a second commodity code, wherein the first commodity code indicates the code corresponding to the commodity in the upstream system, and the second commodity code indicates the code corresponding to the commodity in the downstream system, that is, from the upstream commodity code pair, it can be seen that the code recorded in the upstream system and the code recorded in the downstream system are the same as the upstream commodity code pair. If the upstream system and the downstream system are corresponding, the mapping relationship in the code mapping table of the downstream system is a one-to-one correspondence with the upstream commodity code pair, so each upstream commodity code pair is compared with the code mapping table of the downstream system to determine whether there is a mismatch between the first commodity code and the second commodity code in the code mapping table. The mismatch may be that any one of the first commodity code or the second commodity code does not correspond to the code in the code mapping table, or that the upstream system has added a commodity, so there is no corresponding code mapping relationship in the downstream system at all, so the code mapping table is updated according to different situations to ensure the correspondence and consistency of the codes of the upstream and downstream systems and the normal operation of the upstream and downstream systems.
[0071] In the method provided in the embodiment of the present invention, there are three ways to synchronously update the mapping relationship using the first commodity code or the second commodity code in the upstream commodity code pair, as follows:
[0072] 1. Analyze from the perspective of the first commodity code.
[0073] If there is a mapping relationship corresponding to the first commodity code in the upstream commodity code pair in the code mapping table, determining whether the commodity code corresponding to the first commodity code in the mapping relationship is the same as the second commodity code in the upstream commodity code pair;
[0074] If not, the commodity code corresponding to the first commodity code in the mapping relationship is changed to the second commodity code in the upstream commodity code pair.
[0075] Specifically, if there is a mapping relationship corresponding to the first product code in the upstream product code pair in the code mapping table, but the code corresponding to the first product code in the mapping relationship is different from the second product code in the upstream product code pair, then it is only necessary to synchronously update the code corresponding to the first product code in the mapping relationship to the second product code. In this way, it can be ensured that for the same product, the mapping relationship between its upstream product code pair and the downstream is equal and matched, and consistency can be maintained.
[0076] (ii) Analysis from the perspective of the second commodity code.
[0077] If there is a mapping relationship corresponding to the second commodity code in the upstream commodity code pair in the code mapping table, determining whether the commodity code corresponding to the second commodity code in the mapping relationship is the same as the first commodity code in the upstream commodity code pair;
[0078] If not, the commodity code corresponding to the second commodity code in the mapping relationship is changed to the first commodity code in the upstream commodity code pair.
[0079] Specifically, if there is a mapping relationship corresponding to the second product code in the upstream product code pair in the code mapping table, but the code corresponding to the second product code in the mapping relationship is different from the first product code in the upstream product code pair, then it is only necessary to synchronize the code corresponding to the second product code in the mapping relationship to the first product code. It can also ensure that for the same product, the mapping relationship between its upstream product code pair and the downstream is equal and matching, maintaining the consistency of the upstream and downstream systems.
[0080] (III) The coding of upstream and downstream systems is completely equivalent.
[0081] If the upstream product code of the upstream system is completely equal and matches the code mapping table of the downstream system, it means that there is no need to update and synchronize the product code. Then you can check whether other aspects or data of the product need to be updated synchronously to ensure that all information and data of the product are equal and matched, that is:
[0082] Determine the target product corresponding to the upstream product code pair;
[0083] All basic product information of the target product is obtained, and the product information of the target product stored in the downstream system is updated using the basic product information.
[0084] The above embodiment illustrates the synchronous update of the mapping relationship using the first product code or the second product code in the upstream product code pair in this application. The following embodiment explains in detail the process of converting the upstream product code pair into a mapping relationship and adding it to the code mapping table.
[0085] Determine the target product corresponding to the upstream product code pair;
[0086] Determine the classification of each level to which the target commodity belongs from a preset commodity level classification table;
[0087] Determine the minimum level classification to which the target product belongs as the target classification;
[0088] The upstream commodity code pair is converted into a mapping relationship using the target classification and added into the code mapping table.
[0089] The process of converting the upstream commodity code pair into a mapping relationship by using the target classification and adding it to the code mapping table includes:
[0090] Determine whether, among the mapping relationships in the coding mapping table, there is one or more mapping relationships that contain the target classification in the classifications of the corresponding levels of the commodity;
[0091] If yes, convert the upstream commodity code pair into a mapping relationship, and add it after one or more mapping relationships containing the target classification in the classification of each level to which the corresponding commodity belongs;
[0092] If not, then in each level of classification to which the target product belongs, the classification of the previous level of the target classification will be used as the new target classification, and the step of determining whether there are one or more mapping relationships of the target classification in the classifications of each level to which the corresponding product belongs in each mapping relationship in the coding mapping table, until the classifications of each level to which the product belongs corresponding to each mapping relationship in the coding mapping table do not contain any level of classification to which the target product belongs, then the upstream product code pair will be converted into a mapping relationship and added to after the last mapping relationship in the coding mapping table.
[0093] Specifically, when converting a new upstream commodity code pair into a mapping relationship and adding it to the code mapping table, the positions of the first commodity code and the second commodity code in the upstream commodity code pair are swapped. In an example, an upstream commodity code pair is "20a-69a", the first commodity code is 20a, and the second commodity code is 69a. The mapping relationship after conversion is: "69a-20a". After conversion, it is added to the code mapping table.
[0094] In addition, in order to make the overall arrangement of the code mapping table regular and facilitate more efficient use of the code mapping table when the downstream system operates normally, the present application limits the method of adding mapping relationships, that is, putting the mapping relationships corresponding to goods of the same or similar type levels together, that is, arranging them adjacent to each other in the table, based on the level. Generally speaking, goods are divided into major categories, medium categories, minor categories, details and varieties, and the levels decrease successively. In order to make the newly added mapping relationship be added to the mapping relationship table more accurately and reasonably, starting from the minimum level corresponding to the target product, first take the classification of the minimum level as the target classification, which may be any one of the major category, medium category, minor category, detail and variety. Traverse each mapping relationship in the coding mapping table to see if it can be determined that the classification of the products corresponding to one or more mapping relationships is the same as the target classification. If it can be determined, add it after the corresponding mapping relationship. If it cannot be determined, traverse and search in order according to the level level until the classification of each level of the products corresponding to each mapping relationship in the coding mapping table does not contain any level of classification to which the target product belongs. Then add the added mapping relationship after the last mapping relationship in the coding mapping table.
[0095] Further, the step of determining a coding mapping table in a downstream system corresponding to the upstream system specifically includes:
[0096] Obtaining source information uniformly corresponding to each of the upstream commodity code pairs;
[0097] Determine flow direction information according to the source information;
[0098] Determining a downstream system corresponding to the upstream system based on the flow direction information;
[0099] Extracting the message type of each upstream commodity code pair;
[0100] According to the message type, a coding mapping table is obtained from the downstream system.
[0101] Specifically, the process of obtaining the upstream commodity code pair can be as follows in the following code form:
[0102]
[0103] Among them, the source information is represented by: provider, the flow information is represented by: to, and the message type is represented by: messageType, which represents the identification of the information. The upstream product code pairs are stored in productUrl. Since there may be multiple upstream product code pairs, the amount of data will be too large, even exceeding 1M. Therefore, these upstream product code pairs can be stored in the file server and the corresponding URL (Uniform Resource Locator) can be set. When obtaining the code mapping table, it can be obtained according to the upstream product code pair set in the URL in the file server.
[0104] This application sets different processing methods for different situations, which can improve the adaptability and flexibility of upstream and downstream systems, improve the consistency of product coding / information between upstream and downstream systems, and improve the adaptability of upstream and downstream systems to complex mapping relationships. It is more efficient and accurate than traditional manual processing or single logic processing.
[0105] The present application also provides a product code synchronization system, which includes a product addition processor, a product information update processor and a product mapping relationship processor. If there is no mapping relationship corresponding to the first product code or the second product code in a certain upstream product code pair in the code mapping table, the product addition processor is started to convert the upstream product code pair into a mapping relationship and add it to the code mapping table; if there is a mapping relationship corresponding to the first product code or the second product code in a certain upstream product code pair in the code mapping table, the product mapping relationship processor or the product addition manager is started to use the first product code or the second product code in the upstream product code pair to synchronize and update the mapping relationship table or product information.
[0106] and Figure 1 Corresponding to the method described above, the embodiment of the present invention further provides a commodity code synchronization device for synchronizing Figure 1 In the specific implementation of the method, the commodity code synchronization device provided by the embodiment of the present invention can be used in a computer terminal or various mobile devices, combined with Figure 2 , introduce the commodity coding synchronization device, such as Figure 2 As shown, the device may include:
[0107] The upstream commodity code pair acquisition module 10 is used to acquire each upstream commodity code pair of the upstream system; wherein the upstream commodity code pair is composed of a first commodity code and a second commodity code, wherein the first commodity code indicates the code corresponding to the commodity in the upstream system, and the second commodity code indicates the code corresponding to the commodity in the downstream system;
[0108] A code mapping table determination module 20, used to determine a code mapping table in a downstream system corresponding to the upstream system;
[0109] A determination module 30 is used to determine, for each upstream commodity code pair, whether there is a mapping relationship corresponding to the first commodity code or the second commodity code in the upstream commodity code pair in the code mapping table;
[0110] A synchronous updating module 40, configured to synchronously update the mapping relationship using the first commodity code or the second commodity code in the upstream commodity code pair if yes;
[0111] The adding module 50 is used to add the upstream commodity code pair as a mapping relationship to the code mapping table if no.
[0112] It can be seen from the above technical solution that the present application obtains each upstream commodity code pair of the upstream system; wherein the upstream commodity code pair is composed of a first commodity code and a second commodity code, the first commodity code represents the code corresponding to the commodity in the upstream system, and the second commodity code represents the code corresponding to the commodity in the downstream system; determines the code mapping table in the downstream system corresponding to the upstream system; for each of the upstream commodity code pairs, determines whether there is a mapping relationship corresponding to the first commodity code or the second commodity code in the upstream commodity code pair in the code mapping table; if so, uses the first commodity code or the second commodity code in the upstream commodity code pair to synchronously update the mapping relationship; if not, converts the upstream commodity code pair into a mapping relationship and adds it to the code mapping table. This solution obtains an upstream commodity code pair about the commodity code of the upstream system, and the upstream commodity code pair is composed of a first commodity code and a second commodity code, wherein the first commodity code indicates the code corresponding to the commodity in the upstream system, and the second commodity code indicates the code corresponding to the commodity in the downstream system, that is, from the upstream commodity code pair, it can be seen that the code recorded in the upstream system and the code recorded in the downstream system are the same as the upstream commodity code pair. If the upstream system and the downstream system are corresponding, the mapping relationship in the code mapping table of the downstream system is a one-to-one correspondence with the upstream commodity code pair, so each upstream commodity code pair is compared with the code mapping table of the downstream system to determine whether there is a mismatch between the first commodity code and the second commodity code in the code mapping table. The mismatch may be that any one of the first commodity code or the second commodity code does not correspond to the code in the code mapping table, or that the upstream system has added a commodity, so there is no corresponding code mapping relationship in the downstream system at all, so the code mapping table is updated according to different situations to ensure the correspondence and consistency of the codes of the upstream and downstream systems and the normal operation of the upstream and downstream systems.
[0113] Furthermore, the embodiment of the present application provides a commodity code synchronization device. Optionally, Figure 3The hardware structure diagram of the commodity coding synchronization device is shown in FIG. Figure 3 The hardware structure of the commodity coding synchronization device may include: at least one processor 01, at least one communication interface 02, at least one memory 03 and at least one communication bus 04.
[0114] In the embodiment of the present application, the number of the processor 01 , the communication interface 02 , the memory 03 , and the communication bus 04 is at least one, and the processor 01 , the communication interface 02 , and the memory 03 communicate with each other through the communication bus 04 .
[0115] The processor 01 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
[0116] The memory 03 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), etc., such as at least one disk memory.
[0117] The memory stores a program, and the processor can call the program stored in the memory, and the program is used to execute the following commodity code synchronization method, including:
[0118] Obtain each upstream commodity code pair of the upstream system; wherein the upstream commodity code pair consists of a first commodity code and a second commodity code, wherein the first commodity code indicates the code corresponding to the commodity in the upstream system, and the second commodity code indicates the code corresponding to the commodity in the downstream system;
[0119] Determine a coding mapping table in a downstream system corresponding to the upstream system;
[0120] For each of the upstream commodity code pairs, determining whether there is a mapping relationship corresponding to the first commodity code or the second commodity code in the upstream commodity code pair in the code mapping table;
[0121] If yes, then the mapping relationship is synchronously updated using the first commodity code or the second commodity code in the upstream commodity code pair;
[0122] If not, the upstream commodity code pair is converted into a mapping relationship and added to the code mapping table.
[0123] Optionally, the detailed functions and extended functions of the program may refer to the description of the commodity code synchronization method in the method embodiment.
[0124] The embodiment of the present application further provides a storage medium, which may store a program suitable for execution by a processor, and when the program is executed, controls the device where the storage medium is located to execute the following commodity code synchronization method, including:
[0125] Obtain each upstream commodity code pair of the upstream system; wherein the upstream commodity code pair consists of a first commodity code and a second commodity code, wherein the first commodity code indicates the code corresponding to the commodity in the upstream system, and the second commodity code indicates the code corresponding to the commodity in the downstream system;
[0126] Determine a coding mapping table in a downstream system corresponding to the upstream system;
[0127] For each of the upstream commodity code pairs, determining whether there is a mapping relationship corresponding to the first commodity code or the second commodity code in the upstream commodity code pair in the code mapping table;
[0128] If yes, then the mapping relationship is synchronously updated using the first commodity code or the second commodity code in the upstream commodity code pair;
[0129] If not, the upstream commodity code pair is converted into a mapping relationship and added to the code mapping table.
[0130] Specifically, the storage medium may be a computer-readable storage medium, and the computer-readable storage medium may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk or a ROM.
[0131] Optionally, the detailed functions and extended functions of the program may refer to the description of the commodity code synchronization method in the method embodiment.
[0132] In addition, the functional modules in the various embodiments of the present disclosure can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. If the function is implemented in the form of a software functional module 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 the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a live broadcast device, or a network device, etc.) to perform all or part of the steps of the methods of the various embodiments of the present disclosure.
[0133] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0134] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0135] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for synchronizing commodity codes, characterized in that: include: Obtain each upstream commodity code pair of the upstream system; wherein the upstream commodity code pair consists of a first commodity code and a second commodity code, wherein the first commodity code indicates the code corresponding to the commodity in the upstream system, and the second commodity code indicates the code corresponding to the commodity in the downstream system; Determine a coding mapping table in a downstream system corresponding to the upstream system; For each of the upstream commodity code pairs, determining whether there is a mapping relationship corresponding to the first commodity code or the second commodity code in the upstream commodity code pair in the code mapping table; If yes, then the mapping relationship is synchronously updated using the first commodity code or the second commodity code in the upstream commodity code pair; If not, the upstream commodity code pair is converted into a mapping relationship and added to the code mapping table.
2. The method according to claim 1, characterized in that The synchronously updating the mapping relationship by using the first commodity code or the second commodity code in the upstream commodity code pair includes: If there is a mapping relationship corresponding to the first commodity code in the upstream commodity code pair in the code mapping table, determining whether the commodity code corresponding to the first commodity code in the mapping relationship is the same as the second commodity code in the upstream commodity code pair; If not, the commodity code corresponding to the first commodity code in the mapping relationship is changed to the second commodity code in the upstream commodity code pair.
3. The method according to claim 1, characterized in that The synchronously updating the mapping relationship by using the first commodity code or the second commodity code in the upstream commodity code pair includes: If there is a mapping relationship corresponding to the second commodity code in the upstream commodity code pair in the code mapping table, determining whether the commodity code corresponding to the second commodity code in the mapping relationship is the same as the first commodity code in the upstream commodity code pair; If not, the commodity code corresponding to the second commodity code in the mapping relationship is changed to the first commodity code in the upstream commodity code pair.
4. The method according to claim 1, characterized in that: Also includes: Determine the target product corresponding to the upstream product code pair; All basic product information of the target product is obtained, and the product information of the target product stored in the downstream system is updated using the basic product information.
5. The method according to claim 1, characterized in that The converting the upstream commodity code pair into a mapping relationship and adding it to the code mapping table includes: Determine the target product corresponding to the upstream product code pair; Determine the classification of each level to which the target commodity belongs from a preset commodity level classification table; Determine the minimum level classification to which the target product belongs as the target classification; The upstream commodity code pair is converted into a mapping relationship using the target classification and added into the code mapping table.
6. The method according to claim 5, characterized in that The step of converting the upstream commodity code pair into a mapping relationship by using the target classification and adding the mapping relationship into the code mapping table includes: Determine whether, among the mapping relationships in the coding mapping table, there is one or more mapping relationships that contain the target classification in the classifications of the corresponding levels of the commodity; If yes, convert the upstream commodity code pair into a mapping relationship, and add it after one or more mapping relationships containing the target classification in the classification of each level to which the corresponding commodity belongs; If not, then in each level of classification to which the target product belongs, the classification of the previous level of the target classification will be used as the new target classification, and the step of determining whether there are one or more mapping relationships of the target classification in the classifications of each level to which the corresponding product belongs in each mapping relationship in the coding mapping table, until the classifications of each level to which the product belongs corresponding to each mapping relationship in the coding mapping table do not contain any level of classification to which the target product belongs, then the upstream product code pair will be converted into a mapping relationship and added to after the last mapping relationship in the coding mapping table.
7. The method according to claim 1, characterized in that The determining of a coding mapping table in a downstream system corresponding to the upstream system includes: Obtaining source information uniformly corresponding to each of the upstream commodity code pairs; Determine flow direction information according to the source information; Determining a downstream system corresponding to the upstream system based on the flow direction information; Extracting the message type of each upstream commodity code pair; According to the message type, a coding mapping table is obtained from the downstream system.
8. A commodity code synchronization device, characterized in that: include: An upstream commodity code pair acquisition module is used to acquire each upstream commodity code pair of the upstream system; wherein the upstream commodity code pair is composed of a first commodity code and a second commodity code, wherein the first commodity code indicates the code corresponding to the commodity in the upstream system, and the second commodity code indicates the code corresponding to the commodity in the downstream system; A coding mapping table determination module, used to determine a coding mapping table in a downstream system corresponding to the upstream system; A determination module, configured to determine, for each upstream commodity code pair, whether there is a mapping relationship corresponding to the first commodity code or the second commodity code in the upstream commodity code pair in the code mapping table; a synchronous updating module, configured to synchronously update the mapping relationship by using the first commodity code or the second commodity code in the upstream commodity code pair if yes; The adding module is used to add the upstream commodity code pair as a mapping relationship to the code mapping table if not.
9. A commodity code synchronization device, characterized in that: including memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the commodity code synchronization method as described in any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the commodity code synchronization method as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Inter-system data sharing method and system based on industrial internet identifier analysis
CN117294671A
Method and system for allocating and transacting with multiple non-financial commodities
US20170337543A1
