Supervision code generation method and traceability platform
By introducing the time code segment mechanism into the regulatory code generation system, the problem of the regulatory code generation system running out of code segments when the number of enterprises increases is solved, enabling unlimited application for regulatory codes and improving system scalability.
Patent Information
- Application Number
- CN202110967701.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2016-06-30
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2036-06-30
AI Technical Summary
The existing regulatory code generation system runs out of code segments when production companies, product types and specifications increase, resulting in poor scalability of regulatory codes and the inability to apply for unlimited regulatory codes.
The time code segment mechanism is adopted to receive application requests through the traceability platform and generate supervision codes based on time information to ensure unlimited application for code segments and avoid expansion of the number of code segment digits.
It realizes unlimited application for supervision codes, improves the scalability of the system, and avoids the problem of code segments continuously expanding as the number of enterprises increases.
Smart Images

Figure CN113807864B
Abstract
Description
[0001] This application is a divisional application of the invention patent with application date of June 30, 2016, application number "201610511308.1", and invention name "Supervision code generation method, device and server". Technical Field
[0002] The present disclosure relates to Internet technology, and in particular to a supervision code generation method and a traceability platform. Background Art
[0003] The supervision code is an identification given to each product for the purpose of electronic supervision of the product. Each product has a unique supervision code, that is, "one product, one code". The supervision code is like the identity card of each product.
[0004] In the prior art, the regulatory code is a 20-digit digital sequence, such as 80123451234567891111, wherein the first two digits (e.g., 80) are a prefix used to identify the type of product; the five digits after the prefix (e.g., 12345) are a code segment used to identify the manufacturer and product information of the product, where the product information includes information such as the product name and product specifications, and each specification of the same product produced by the same manufacturer corresponds to a code segment; the nine digits after the code segment (e.g., 123456789) are a serial number, which is used to identify each product of the same specification of the same product produced by the same manufacturer; the four digits after the serial number (e.g., 1111) are check bits, which are the result of checking the first 16 digits of the regulatory code according to a check algorithm.
[0005] The code segments are generated in sequence, specifically from 00000 to 99999, that is, the maximum number of non-repeating code segments is 100,000. However, with the increase in manufacturers, product types, and product specifications, more and more code segments are occupied, and 100,000 code segments will be exhausted quickly, resulting in manufacturers being unable to apply for regulatory codes without restrictions. In addition, the prefix and serial number are also generated in sequence. When the prefix, code segment, and serial number are increased to the maximum value, all the digits of the regulatory code have been exhausted. If the regulatory code continues to increase, the length of the regulatory code needs to be increased. Therefore, it is necessary to uniformly transform the generation, management, and maintenance systems of the regulatory code, resulting in poor scalability of the regulatory code. Summary of the invention
[0006] The present disclosure provides a supervision code generation method and a traceability platform to achieve unlimited application for supervision codes.
[0007] In one aspect, the present disclosure provides a method for generating a supervision code, comprising:
[0008] The traceability platform receives the application request sent by the application device, wherein the application request includes the name of the goods and the number of regulatory codes required to be applied for;
[0009] At least determine the time code segment based on the time information set on the traceability platform after the application device logs into the traceability platform;
[0010] A supervision code is generated according to the time code segment.
[0011] In another aspect, the present disclosure provides a traceability platform, including: a processor, the processor being configured to execute the steps of the following method:
[0012] The traceability platform receives the application request sent by the application device, wherein the application request includes the name of the goods and the number of regulatory codes required to be applied for;
[0013] At least determine the time code segment based on the time information set on the traceability platform after the application device logs into the traceability platform;
[0014] A supervision code is generated according to the time code segment.
[0015] In the present disclosure, the time code segment is associated with the time information. Since the time information is a continuously changing information, the time information will continue to increase with the increase of time, ensuring that the time code segment can be applied without restriction. The supervision code is generated based on the time code segment, thereby realizing that the supervision code can be applied without restriction. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0017] Figure 1 It is a schematic diagram of the structure of the supervision code in the prior art;
[0018] Figure 2 A schematic diagram of the structure of an optional supervision code disclosed in the present invention;
[0019] Figure 3 A schematic diagram of an optional application scenario / networking method of the present disclosure;
[0020] Figure 4 An architectural diagram of the generation of the supervision code provided in the first embodiment of the present disclosure;
[0021] Figure 5 A flowchart of a method for generating a supervision code provided in Embodiment 2 of the present disclosure;
[0022] Figure 6 A flowchart of a method for generating a supervision code provided in Embodiment 2 of the present disclosure;
[0023] Figure 7 A flowchart of a method for generating a supervision code provided in Embodiment 3 of the present disclosure;
[0024] Figure 8 A flowchart of a method for generating a supervision code provided in Embodiment 4 of the present disclosure;
[0025] Fig. 9 A flowchart of a method for generating a supervision code provided in Embodiment 5 of the present disclosure;
[0026] Fig.10 A flowchart of a method for generating a supervision code provided in Embodiment 6 of the present disclosure;
[0027] Fig.11 A flowchart of a method for generating a supervision code provided in Embodiment 7 of the present disclosure;
[0028] Fig.12 A flowchart of a method for generating a supervision code provided in Embodiment 8 of the present disclosure;
[0029] Fig.13 A flowchart of a method for generating a supervision code provided in Embodiment 9 of the present disclosure;
[0030] Fig.14 A flowchart of a method for generating a supervision code provided in Embodiment 10 of the present disclosure;
[0031] Fig.15 A flowchart of a method for generating a supervision code provided in the eleventh embodiment of the present disclosure;
[0032] Fig.16 A flowchart of a method for generating a supervision code provided in Embodiment 12 of the present disclosure;
[0033] Fig.17 A flowchart of a method for generating a supervision code provided in Embodiment 13 of the present disclosure;
[0034] Fig.18 A flowchart of a method for generating a supervision code provided in Embodiment 14 of the present disclosure;
[0035] Fig.19 A flowchart of a method for generating a supervision code provided in Embodiment 15 of the present disclosure;
[0036] Fig. 20 A flowchart of a method for generating a supervision code provided in Embodiment 16 of the present disclosure;
[0037] Fig.21 A flowchart of a method for generating a supervision code provided in Embodiment 17 of the present disclosure;
[0038] Fig. 22 A schematic diagram of the structure of a server provided in Embodiment 1 of the present disclosure;
[0039] Fig.23 A schematic diagram of the structure of a server provided in Embodiment 2 of the present disclosure;
[0040] Fig.24 A schematic diagram of the structure of a server provided in Embodiment 3 of the present disclosure;
[0041] Fig.25 A schematic diagram of the structure of a terminal device provided in Embodiment 1 of the present disclosure;
[0042] Fig.26 A schematic diagram of the structure of a terminal device provided in Embodiment 2 of the present disclosure;
[0043] Fig. 27 A schematic diagram of the structure of a supervision code generation system provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0044] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0045] In the prior art, the supervision code is a 20-digit digital sequence, such as Figure 1 As shown, the 20-digit regulatory code includes a two-digit prefix 11, a five-digit code segment 12, a nine-digit serial number 13, and a four-digit check bit 14. The prefix 11 is used to identify the type of product; the code segment 12 is used to identify the manufacturer and product information of the product. The product information includes product name, product specifications and other information. Each specification of the same product produced by the same manufacturer corresponds to a code segment; the serial number 13 is used to identify each product of the same specification of the same product produced by the same manufacturer; the check bit 14 is the result of checking the first 16 bits of the regulatory code according to the check algorithm.
[0046] The prefix 11, code segment 12, and serial number 13 are all generated in sequence. For example, code segment 12 specifically ranges from 00000 to 99999, that is, the maximum number of non-repeating code segments is 100,000. With the increase in production enterprises, product types, and product specifications, 100,000 code segments will be exhausted quickly, resulting in the inability of production enterprises to apply for regulatory codes without restrictions. In addition, when the prefix, code segment, and serial number are increased to the maximum value, all digits of the regulatory code have been exhausted. If the regulatory code continues to increase, the length of the regulatory code needs to be increased. Therefore, it is necessary to uniformly transform the generation, management, and maintenance systems of the regulatory code, resulting in poor scalability of the regulatory code.
[0047] This disclosure aims to solve the problems in the prior art and proposes a method for generating a supervision code. Figure 2 As shown, the supervision code described in the present disclosure is a 35-digit digital sequence, which includes a two-digit prefix 21, a twenty-digit code segment 22, a nine-digit serial number 23, and a four-digit check bit 24, wherein the twenty-digit code segment 22 includes seventeen-digit time information 18 and a three-digit code segment sequence number 19, and the time information 18 is accurate to milliseconds. For example, 20160122034455666 represents 3:44:55 and 666 milliseconds on January 22, 2016, and the code segment sequence number 19 ranges from 000 to 999, and the code segment sequence number identifies multiple Concurrent application, for example, the traceability platform received application requests from manufacturers A, B, C, and D at 3:44:55:666 on January 22, 2016. The application requests were used to apply for supervision codes. There were 4 concurrent requests at 3:44:55:666 on January 22, 2016. The traceability platform can select 4 different code segment numbers from 000-999, such as 001, 002, 003, and 004, to distinguish the 4 concurrent requests at the same time. The code segment 22 in the supervision codes applied for by manufacturer A, manufacturer B, manufacturer C and manufacturer D are 20160122034455666001, 20160122034455666002, 20160122034455666003 and 20160122034455666004 respectively.
[0048] In this embodiment, the time information 18 in the code segment 22 is the time information when the tracing platform receives the application request.
[0049] In addition, in other embodiments, the time information 18 in the code segment 22 may also be the time information when the tracing platform processes the application request.
[0050] In addition, in other embodiments, the time information 18 in the code segment 22 may also be the time information set by the user applying for the supervision code through the application device. The user-selectable time information may be accurate to milliseconds. The application device may be, for example, Figure 3 The application device 11, the application device 12, the application device 13 or the application device 14 sends an application request to the traceability platform according to the user's settings, and the application request includes the time information set by the user.
[0051] In this embodiment, the code segment is associated with the time information. Since the time information is a continuously changing information, the time information can continuously increase with the increase of time, which ensures that the code segment can be applied for without restriction. The regulatory code is generated according to the code segment, thereby realizing that the regulatory code can be applied for without restriction. In addition, the same time information corresponds to a preset number of code segment serial numbers, and the preset number of code segment serial numbers can identify a preset number of concurrent applications at the same time. As long as the number of concurrent requests for regulatory codes at the same time does not exceed the preset number, it can be guaranteed that the processing limit of the system is not exceeded. There is no need to upgrade the system, and there is no need to uniformly transform the generation, management, and maintenance system of the regulatory code, thereby improving the scalability of the regulatory code. The code segment is independent of the number of enterprises, ensuring that the code segment will not increase in sequence with the increase of enterprises, nor will the number of bits of the code segment be expanded with the increase of application requests, which essentially solves the problem that the number of bits of the code segment needs to be continuously expanded with the increase of the number of enterprises.
[0052] This embodiment combines Figure 3 Introduce the process of manufacturers applying for supervision codes from the traceability platform, as well as the generation method of supervision codes, such as Figure 3 As shown, when a manufacturer produces a commodity, it assigns a supervision code to the packaging of the commodity or the commodity itself. Each commodity has a supervision code, which is used to uniquely identify the commodity like an identity card of the commodity. The supervision code can be a symbol with certain commodity information such as a QR code, a graphic code, a barcode, an anti-counterfeiting code, or an invisible label, or a code generated by a specific coding rule. In this embodiment, the supervision code is a string of digital sequences, which is a digital sequence generated by the traceability platform according to the application request of the manufacturer, such as Figure 3 As shown, manufacturer A can apply for a supervision code from the traceability platform through application equipment 11, manufacturer B can apply for a supervision code from the traceability platform through application equipment 12, manufacturer C can apply for a supervision code from the traceability platform through application equipment 13, and manufacturer D can apply for a supervision code from the traceability platform through application equipment 14.
[0053] Before each manufacturer applies for a supervision code from the traceability platform, each manufacturer uploads the information of the goods to the traceability platform through its corresponding application device. For example, manufacturer A uploads the identification information of manufacturer A and the goods information of goods A produced by manufacturer A to the traceability platform through the application device 11. The goods information includes the name of goods A and the specifications of goods A. The traceability platform stores the association between the identification information of manufacturer A, the name of goods A, and the specifications of goods A in the database 10. Similarly, the association between the identification information of manufacturer B, the name of goods B produced by manufacturer B, and the specifications of goods B is stored in the database 10; the association between the identification information of manufacturer C, the name of goods C produced by manufacturer C, and the specifications of goods C is stored in the database 10; the association between the identification information of manufacturer D, the name of goods D produced by manufacturer D, and the specifications of goods D is stored in the database 10. Goods A, goods B, goods C, and goods D can be the same goods or different goods.
[0054] The traceability platform verifies the goods uploaded by manufacturer A, manufacturer B, manufacturer C, and manufacturer D respectively. After the verification is qualified, manufacturer A, manufacturer B, manufacturer C, and manufacturer D can respectively send application requests to the traceability platform through their corresponding application devices. The specific process of sending the application request can be: the personnel of the manufacturer log in to the traceability platform through the application device, query the name and specification of the goods uploaded by the manufacturer and verified by the traceability platform from the traceability platform, determine the number of the goods, that is, the number of regulatory codes required, and then click to confirm the application.
[0055] After receiving the application request, the traceability platform determines the category of the goods according to the name of the goods. In this embodiment, a 2-digit sequence is used to represent the category of the goods. For example, the name of the goods is amoxicillin and the category of the goods is medicine. In addition, the traceability platform pre-stores the correspondence between the category of the goods and the prefix of the regulatory code. For example, the prefix of the regulatory code corresponding to the medicine is 80.
[0056] The traceability platform generates a code segment of the supervision code according to the time information corresponding to the application request, wherein the time information corresponding to the application request may be the time information when the traceability platform receives the application request, or the time information set on the traceability platform by the personnel of the production enterprise after logging into the traceability platform through the application device. For example, the production enterprise expects to sell the goods on June 20, 2016, and applies for the supervision code of the goods on June 12, 2016, then June 20, 2016 is set on the traceability platform, indicating that the production enterprise expects to apply for a code segment associated with June 20, 2016. In addition, the traceability platform may process the application request immediately or with a delay. If the application request is processed with a delay, the time information corresponding to the application request may also be the time information when the traceability platform processes the application request.
[0057] This embodiment takes the time information corresponding to the application request as the time information when the traceability platform receives the application request as an example, and describes in detail the process of the traceability platform generating the code segment of the supervision code according to the time information corresponding to the application request. Figure 1As shown, the traceability platform can receive the application requests sent by the application device 11, the application device 12, the application device 13, and the application device 14 at different times, that is, the application device 11, the application device 12, the application device 13, and the application device 14 do not send the application requests to the traceability platform at the same time. In addition, the traceability platform can also receive the application requests sent by the application device 11, the application device 12, the application device 13, and the application device 14 at the same time, that is, the application device 11, the application device 12, the application device 13, and the application device 14 send the application requests to the traceability platform at the same time. In this embodiment, a 20-digit sequence is used to represent the code segment of the supervision code, wherein the first 17 digits of the code segment represent time information, and the last 3 digits represent the code segment sequence number. Each time information identifies a moment corresponding to a preset number of different code segment sequence numbers. For example, 3:44:55:666 on January 22, 2016 corresponds to 1000 code segment sequence numbers, and the 1000 code segment sequence numbers are from 000 to 999. The time information is represented as 20160122034455666, and 20160122034455666000 can identify 201 20160122034455666001 can identify the first application request at 3:44:55:666 milliseconds on January 22, 2016, 20160122034455666001 can identify the second application request at 3:44:55:666 milliseconds on January 22, 2016, 20160122034455666999 can identify the 1000th application request at 3:44:55:666 milliseconds on January 22, 2016. Similarly, any time other than 3:44:55:666 milliseconds on January 22, 2016 also corresponds to 1000 code segment numbers. In this embodiment, 1000 code segment numbers at each time can identify 1000 concurrent application requests at that time. In addition, this embodiment is only for illustration and does not limit the specific number of code segment numbers corresponding to each time.When application devices 11, 12, 13 and 14 send application requests to the traceability platform at the same time, the traceability platform will receive four application requests at the same time. Assuming that the same time is 3:44:55:666 on January 22, 2016, the traceability platform will sequentially assign regulatory code segments to the four application requests within 3:44:55:666 on January 22, 2016. One application request corresponds to one regulatory code segment. The four segments are 20160122034455666000, 20160122034455666000 and 20160122034455666000 respectively. 55666001, 20160122034455666002, 20160122034455666003. Correspondingly, the code segment of the regulatory code applied for by manufacturer A is 20160122034455666000, the code segment of the regulatory code applied for by manufacturer B is 20160122034455666001, the code segment of the regulatory code applied for by manufacturer C is 20160122034455666002, and the code segment of the regulatory code applied for by manufacturer D is 20160122034455666003. When the traceability platform receives only one application request at the same time, it randomly selects a code segment number from the 1000 code segment numbers corresponding to that moment, or selects a code segment number in sequence, and the time information represented by that moment and the code segment number constitute the code segment of the regulatory code applied for by the application request.
[0058] like Figure 3 As shown, each manufacturer needs to assign a supervision code to each piece of goods it produces. When each manufacturer applies for a supervision code from the traceability platform, it needs to determine the number of supervision codes required to be applied for. This embodiment generates a serial number of the supervision code according to the number of supervision codes applied for by each manufacturer. This embodiment uses a 9-digit sequence to represent the serial number of the supervision code. For example, manufacturer A applies for 10,000 supervision codes at a time to identify 10,000 pieces of goods. The serial number of the supervision code assigned by the traceability platform to manufacturer A is from 0000000000-000009999, 000000000 identifies the first piece of goods, 000000001 identifies the second piece of goods, and 000009999 identifies the 10,000th piece of goods. Similarly, the traceability platform can assign serial numbers of supervision codes to manufacturers B, C, and D respectively.
[0059] In addition, the traceability platform verifies the sequence composed of the prefix, code segment, and serial number of the regulatory code in sequence to generate the check digit of the regulatory code. In this embodiment, a 4-digit sequence is used to represent the check digit of the regulatory code. Taking the first regulatory code of manufacturer A as an example, the prefix is 80, the code segment is 20160122034455666000, and the serial number is 000000000. The traceability platform uses a predetermined verification algorithm to verify the sequence composed of the prefix, code segment, and serial number in sequence, namely 8020160122034455666000000000000, and generates a check digit such as 1111. The prefix, code segment, serial number, and check digit constitute the first regulatory code of manufacturer A in sequence, namely 80201601220344556660000000000001111. Similarly, the second supervision code 80201601220344556660000000000011111 of manufacturer A can be generated, and even the 10000th supervision code 80201601220344556660000000099991111 of manufacturer A can be generated.
[0060] In this embodiment, a 35-digit sequence is used to represent the regulatory code. Compared with the 20-digit regulatory code in the prior art, the difference lies in the code segment of the regulatory code. In the prior art, the code segment is a 5-digit sequence, and the code segment is generated in sequence, specifically from 00000 to 99999, that is, the maximum number of non-repeating code segments is 100,000. 100,000 code segments will be quickly exhausted, which limits the number of code segments that manufacturers apply for, and at the same time limits the number of regulatory codes applied for. The code segment in this embodiment is a 20-bit digital sequence, the first 17 bits of the code segment represent time information, and the last 3 bits represent the code segment sequence number. Since time information is a continuously changing information, the time information can continuously change with the increase of time. By associating the code segment with the time information, it can be ensured that the code segment is continuously applied for. In addition, each time information corresponds to 1000 code segment sequences, and the 1000 code segment sequences are used to identify 1000 concurrent application requests at the same time. The first 17 bits of the code segments of multiple regulatory codes applied at the same time are equal, and the last 3 bits are different, which ensures that the code segments of multiple regulatory codes applied at the same time are different, avoiding the duplication of code segments of multiple regulatory codes applied at the same time, thereby avoiding the duplication of multiple regulatory codes applied at the same time.
[0061] In addition, the code segment is associated with the time information. As time changes, the time information can change continuously. The code segment changes with the change of the time information. Compared with the prior art that the code segment is generated in sequence, it can effectively solve the problem of the continuous increase of the code segment and the continuous expansion of the code segment bit number. And the method of allocating code segments according to time information is simple, the processing time delay is short, and the processing speed of the system can be effectively improved.
[0062] In addition, since the code segment in this embodiment is associated with time information, and the time information is accurate to milliseconds, the length of the time information in the code segment is fixed, and the time information in the code segment can change continuously with the change of time, each time information corresponds to a preset number of code segment serial numbers, and the preset number of code segment serial numbers can identify the preset number of concurrent requests at the same time. The code segment includes time information and code segment serial numbers, which ensures that the code segment can not only identify the code segments applied at different times, but also identify the code segments applied by multiple concurrent requests at the same time. As long as the number of concurrent requests for regulatory codes at the same time does not exceed the preset number, it can be guaranteed that the processing limit of the system is not exceeded, and there is no need to upgrade the system, and there is no need to uniformly transform the generation, management, and maintenance system of regulatory codes, which improves the scalability of regulatory codes. The code segment is independent of the number of enterprises, ensuring that the code segment will not increase in sequence with the increase of enterprises, nor will the number of bits of the code segment be expanded with the increase of application requests, which essentially solves the problem that the number of bits of the code segment needs to be continuously expanded with the increase of the number of enterprises.
[0063] The first embodiment of the present disclosure provides a method for generating a supervision code, the method comprising the following steps:
[0064] Step 1: Receive the application request sent by the application device.
[0065] The execution subject of this embodiment is the traceability platform, which is specifically implemented as follows: Figure 4 The server 10 shown in FIG. Figure 4 As shown, manufacturer A can apply for a supervision code from the traceability platform through application equipment 11, manufacturer B can apply for a supervision code from the traceability platform through application equipment 12, manufacturer C can apply for a supervision code from the traceability platform through application equipment 13, and manufacturer D can apply for a supervision code from the traceability platform through application equipment 14. Specifically, manufacturer A, manufacturer B, manufacturer C, and manufacturer D respectively send application requests to the traceability platform through their corresponding application devices, and the application requests are used to apply for supervision codes.
[0066] Step 2: Determine a time code segment based at least on the time information associated with the application request.
[0067] In this embodiment, the time information associated with the application request may be the time information when the traceability platform receives the application request. In addition, in other embodiments, the time information associated with the application request may be the time information when the traceability platform processes the application request. In addition, in other embodiments, the application request also includes the time information, and the time information is the time information set by the user through the application device. Alternatively, the time information associated with the application request may also be the time information when the application device sends the application request.
[0068] For example, January 22, 2016 3:44:55:666 milliseconds represents time information, and the time code segment determined based on the time information may be 20160122034455666. Alternatively, a preset delay time such as 4 milliseconds is added to the time information January 22, 2016 3:44:55:666 milliseconds to obtain another time information January 22, 2016 3:44:55:670 milliseconds, and the time code segment determined based on January 22, 2016 3:44:55:670 milliseconds may be 20160122034455670. Alternatively, the time code segment determined according to the time information of 3:44:55:666 on January 22, 2016 may be 20160122034455666001, that is, a 3-digit code segment number 001 is added after 20160122034455666, and the number of digits of the code segment number is not limited in this embodiment. The traceability platform may generate a supervision code according to the time code segment.
[0069] Optionally, server 10 receives application requests sent by application device 11, application device 12, application device 13, and application device 14 at 3:44:55:666 on January 22, 2016. Server 10 assigns time code segments to the four concurrent application requests in sequence, one application request corresponds to one time code segment, and the four time code segments are 20160122034455666000, 20160122034455666001, 20160122034455666002, and 20160122034455666003. 666002, 20160122034455666003. Correspondingly, the time code segment allocated to the applicant device 11 is 20160122034455666000, the time code segment allocated to the applicant device 12 is 20160122034455666001, the time code segment allocated to the applicant device 13 is 20160122034455666002, and the time code segment allocated to the applicant device 14 is 20160122034455666003.
[0070] Step 3: Generate a supervision code according to the time code segment, and send the supervision code to the applying device.
[0071] The server 10 generates a supervision code 31 according to the time code segment 20160122034455666000, generates a supervision code 32 according to the time code segment 20160122034455666001, generates a supervision code 33 according to the time code segment 20160122034455666002, and generates a supervision code 34 according to the time code segment 20160122034455666003. Figure 4 The diagram shows the architecture of the supervision code generation, where the supervision codes 31-34 are sent to the application devices 11-14 respectively.
[0072] In this embodiment, the time code segment is associated with the time information. Since the time information is a continuously changing information, the time information will continue to increase with the increase of time, ensuring that the time code segment can be applied without restriction. The supervision code is generated based on the time code segment, thereby realizing that the supervision code can be applied without restriction.
[0073] Figure 5 This is a flowchart of the method for generating a supervision code provided in the second embodiment of the present disclosure, such as Figure 5 As shown, in Figure 4 Based on the illustrated embodiment, the method comprises the following steps:
[0074] Step S201: Receive an application request sent by an application device.
[0075] The execution subject of this embodiment is the traceability platform, such as Figure 1 As shown, manufacturer A can apply for a supervision code from the traceability platform through application equipment 11, manufacturer B can apply for a supervision code from the traceability platform through application equipment 12, manufacturer C can apply for a supervision code from the traceability platform through application equipment 13, and manufacturer D can apply for a supervision code from the traceability platform through application equipment 14. Specifically, manufacturer A, manufacturer B, manufacturer C, and manufacturer D respectively send application requests to the traceability platform through their corresponding application devices, and the application requests are used to apply for supervision codes.
[0076] Step S202: Determine a time code segment at least according to the time information associated with the application request.
[0077] Step S202 is consistent with step S102, and the specific method will not be repeated here.
[0078] Step S203: Generate a supervision code at least according to the time code segment.
[0079] In this embodiment, the application request includes the name of the goods and the number of regulatory codes required to be applied for. The time code segment is the time code segment described in step S102.
[0080] The execution subject of this embodiment is the traceability platform, such as Figure 1 As shown, manufacturer A can apply for a supervision code from the traceability platform through application equipment 11, manufacturer B can apply for a supervision code from the traceability platform through application equipment 12, manufacturer C can apply for a supervision code from the traceability platform through application equipment 13, and manufacturer D can apply for a supervision code from the traceability platform through application equipment 14. Specifically, manufacturer A, manufacturer B, manufacturer C, and manufacturer D respectively send application requests to the traceability platform through their corresponding application devices, and the application requests include the manufacturer's identification information, the name of the goods, the specifications of the goods, and the number of required supervision codes.
[0081] like Figure 6 As shown, at least according to the time code segment, the method for generating a supervision code specifically includes the following steps:
[0082] Step S31, determining the prefix of the supervision code according to the name of the goods;
[0083] After receiving the application request, the traceability platform determines the category of the goods according to the name of the goods. In this embodiment, a 2-digit sequence is used to represent the category of the goods. For example, the name of the goods is amoxicillin and the category of the goods is medicine. In addition, the traceability platform pre-stores the correspondence between the category of the goods and the prefix of the regulatory code. For example, the prefix of the regulatory code corresponding to the medicine is 80.
[0084] Step S32: determining the serial number of each regulatory code according to the number of regulatory codes required to be applied for, wherein the serial number of each regulatory code is continuously increased;
[0085] like Figure 1 As shown, each manufacturer needs to assign a supervision code to each piece of goods it produces. When each manufacturer applies for a supervision code from the traceability platform, it needs to determine the quantity of goods, that is, the number of supervision codes required. This embodiment generates a supervision code serial number according to the number of supervision codes applied for by each manufacturer. This embodiment uses a 9-digit sequence to represent the supervision code serial number. For example, manufacturer A applies for 10,000 supervision codes at a time to identify 10,000 goods. The traceability platform assigns the supervision code serial number to manufacturer A from 000000000-000009999, 000000000 identifies the first piece of goods, 000000001 identifies the second piece of goods, and 000009999 identifies the 10,000th piece of goods. Similarly, the traceability platform can assign supervision code serial numbers to manufacturers B, C, and D, respectively.
[0086] Step S33, verifying the sequence consisting of the prefix, the time code segment, and the serial number to generate a check digit of the supervision code;
[0087] The traceability platform verifies the sequence consisting of the prefix, time code segment, and serial number of the supervision code to generate a check digit of the supervision code. In this embodiment, a 4-digit sequence is used to represent the check digit of the supervision code. Taking the first supervision code of manufacturer A as an example, the prefix is 80, the time code segment is 20160122034455666, and the serial number is 000000000. The traceability platform uses a predetermined verification algorithm to verify the sequence consisting of the prefix, time code segment, and serial number, i.e., 8020160122034455666000000000, to generate a check digit such as 1111.
[0088] Step S34: The prefix, the time code segment, the serial number, and the check digit constitute the supervision code.
[0089] The prefix, time code segment, serial number, and check digit constitute the first regulatory code of manufacturer A, namely 80201601220344556660000000001111. Similarly, the second regulatory code of manufacturer A can be generated as 80201601220344556660000000011111, and even the 10000th regulatory code of manufacturer A can be generated as 80201601220344556660000099991111.
[0090] Step S204: Send the supervision code to the application device.
[0091] In this embodiment, the time code segment is associated with the time information. Since the time information is a continuously changing information, the time information will continue to increase with the increase of time, ensuring that the time code segment can be applied without restriction. The supervision code is generated based on the time code segment, thereby realizing that the supervision code can be applied without restriction.
[0092] Figure 7 This is a flowchart of the method for generating a supervision code provided in the third embodiment of the present disclosure, such as Figure 7 As shown, in Figure 5 Based on the illustrated embodiment, the method comprises the following steps:
[0093] Step S401: Receive an application request sent by an application device.
[0094] After receiving the application request, the traceability platform obtains the time information when the application request is received.
[0095] Step S402: Determine a time code segment at least according to the time information when the application request is received.
[0096] The traceability platform can determine the time code segment according to the time information when the application request is received. For example, the traceability platform receives the application request at 3:44:55:666 on January 22, 2016. The time code segment determined according to the time information 3:44:55:666 on January 22, 2016 is 20160122034455666.
[0097] Step S403: Generate a supervision code at least according to the time code segment.
[0098] Step S404: Send the supervision code to the application device.
[0099] Step S403 is consistent with step S203, and step S404 is consistent with step S204. The specific method will not be repeated here.
[0100] In this embodiment, the traceability platform determines the time code segment based on the time information when the application request is received. The time code segment is associated with the time information. Since the time information is a continuously changing information, the time information will continue to increase with the increase of time, ensuring that the time code segment can be applied for without restriction. The supervision code is generated based on the time code segment, thereby realizing that the supervision code can be applied for without restriction.
[0101] Figure 8 This is a flowchart of a method for generating a supervision code provided in Embodiment 4 of the present disclosure, such as Figure 8 As shown, in Figure 7 Based on the illustrated embodiment, the method comprises the following steps:
[0102] Step S501: Receive an application request sent by an application device.
[0103] Step S502: Determine the number of application requests received at the time identified by the time information.
[0104] The time information is the time information when the traceability platform receives the application request in step S402. The number of application requests received at the time identified by the time information is N, where N is greater than 1.
[0105] like Figure 3 As shown, the traceability platform receives the application request sent by the application device 11 at 3:44:55:666 on January 22, 2016. The traceability platform further determines the number of application requests received at this time based on the time information 3:44:55:666 on January 22, 2016. Since multiple application devices can send application requests to the traceability platform at the same time, the traceability platform can optionally receive application requests sent by the application devices 11, 12, 13, and 14 at the same time, that is, the application devices 11, 12, 13, and 14 send application requests to the traceability platform at the same time. Since the time information can be accurate to milliseconds, for example, at 3:44:55:666 on January 22, 2016, when there are many manufacturers applying for supervision codes from the traceability platform, multiple manufacturers may send application requests to the traceability platform at the same time. This embodiment takes the traceability platform receiving multiple application requests at the same time as an example to illustrate the method for generating supervision codes.
[0106] Step S503: Add N different time offsets to the time information to generate N first time offset information. One application request corresponds to one first time offset information.
[0107] For example, the traceability platform receives application requests sent by application device 11, application device 12, application device 13 and application device 14 at 3:44:55:666 on January 22, 2016. Then, the traceability platform adds four different time offsets based on the time information of 3:44:55:666 on January 22, 2016. For example, the four different time offsets are 1 millisecond, 3 milliseconds, 5 milliseconds and 7 milliseconds respectively, and generates four first time offset information. The four first time offset information are 3:44:55:667 on January 22, 2016, 3:44:55:669 on January 22, 2016, 3:44:55:671 on January 22, 2016 and 3:44:55:673 on January 22, 2016. One application request corresponds to one first time offset information. For example, the application request sent by the application device 11 corresponds to 3:44:55:667 milliseconds on January 22, 2016; the application request sent by the application device 12 corresponds to 3:44:55:669 milliseconds on January 22, 2016; the application request sent by the application device 13 corresponds to 3:44:55:671 milliseconds on January 22, 2016; and the application request sent by the application device 14 corresponds to 3:44:55:673 milliseconds on January 22, 2016.
[0108] Step S504: determine the time code segment according to the first time offset information corresponding to each application request, wherein the time code segment includes the first time offset information.
[0109] The tracing platform generates a time code segment according to the first time offset information corresponding to each application request. For example, the time code segment generated according to 3:44:55:667 on January 22, 2016 is 20160123034455667; the time code segment generated according to 3:44:55:669 on January 22, 2016 is 20160123034455669; the time code segment generated according to 3:44:55:671 on January 22, 2016 is 20160123034455671; the time code segment generated according to 3:44:55:673 on January 22, 2016 is 20160123034455673.
[0110] Step S505, generating a supervision code at least according to the time code segment;
[0111] Step S506: Send the supervision code to the application device.
[0112] Step S505 is consistent with step S203, and step S506 is consistent with step S204. The specific method will not be repeated here.
[0113] In this embodiment, when the traceability platform receives multiple application requests at the same time, the traceability platform adds multiple different time offsets to the time information corresponding to the time, generates multiple first time offset information, one application request corresponds to one first time offset information, and generates the time code segment of the regulatory code applied for by each application request according to the first time offset information corresponding to the application request, thereby ensuring that the time code segments of multiple regulatory codes applied for at the same time are different, thereby avoiding duplication of multiple regulatory codes applied for at the same time.
[0114] Fig. 9 This is a flowchart of the method for generating a supervision code provided in Embodiment 5 of the present disclosure, such as Fig. 9 As shown, in Figure 7 Based on the illustrated embodiment, the method comprises the following steps:
[0115] Step S601: Receive an application request sent by an application device.
[0116] Step S602: Determine the number of application requests received at the time identified by the time information.
[0117] The time information is the time information when the traceability platform receives the application request in step S402. The number of application requests received at the moment identified by the time information is N, where N is greater than 1; the time information corresponds to M different code segment numbers, where M is greater than or equal to N.
[0118] For example, the tracing platform simultaneously receives application requests sent by application device 11, application device 12, application device 13, and application device 14 at 3:44:55:666 on January 22, 2016, that is, the number N of application requests corresponding to 3:44:55:666 on January 22, 2016 is 4. In addition, each time information identifies a moment corresponding to a preset number of different code segment numbers. For example, 3:44:55:666 on January 22, 2016 corresponds to 1000 code segment numbers, and the 1000 code segment numbers range from 000 to 999. 20160122034455666000 can identify the first application request at 3:44:55:666 on January 22, 2016, and 20160122034455666000 can identify the first application request at 3:44:55:666 on January 22, 2016. 4455666001 can identify the second application request at 3:44:55:666 milliseconds on January 22, 2016, and 20160122034455666999 can identify the 1000th application request at 3:44:55:666 milliseconds on January 22, 2016. Similarly, any time other than 3:44:55:666 milliseconds on January 22, 2016 also corresponds to 1000 code segment numbers.
[0119] Step S603: Obtain N different code segment numbers from the M different code segment numbers.
[0120] In this embodiment, the number of code segment serial numbers corresponding to the moment identified by each time information is greater than the number of concurrent requests received by the tracing platform at that moment, that is, the number of concurrent requests received by the tracing platform at a certain moment does not exceed 1000.
[0121] The traceability platform obtains 4 different code segment numbers, such as 004, 007, 009, and 020, from the 1000 code segment numbers corresponding to 3:44:55:666 milliseconds on January 22, 2016.
[0122] Step S604: Generate N different time code segments according to the time information and the N different code segment numbers, each time code segment includes the time information and a code segment number among the N different code segment numbers, and one application request corresponds to one time code segment.
[0123] The traceability platform generates four different time code segments based on the time information of January 22, 2016 at 3:44:55.666 milliseconds and four different code segment numbers, such as 004, 007, 009, and 020. The four different time code segments are 20160122034455666004, 20160122034455666007, 20160122034455666009, and 20160122034455666020. One application request corresponds to A time code segment, for example, the time code segment corresponding to the application request sent by application device 11 is 20160122034455666004, the time code segment corresponding to the application request sent by application device 12 is 20160122034455666007, the time code segment corresponding to the application request sent by application device 13 is 20160122034455666009, and the time code segment corresponding to the application request sent by application device 14 is 20160122034455666020.
[0124] In addition, the N different code segment numbers increase continuously. For example, the four different code segment numbers are 001, 002, 003, and 004. January 22, 2016, 3:44:55.666 milliseconds and four different code segment numbers generate four different time code segments, and the four different time code segments are 20160122034455666001, 20160122034455666002, 20160122034455666003, and 20160122034455666004.
[0125] Step S605, generating a supervision code at least according to the time code segment;
[0126] Step S606: Send the supervision code to the application device.
[0127] Step S605 is consistent with step S203, and step S606 is consistent with step S204. The specific method will not be repeated here.
[0128] In this embodiment, each time information corresponds to multiple different code segment numbers, and the multiple different code segment numbers can identify multiple concurrent application requests received by the traceability platform at the same time. The traceability platform assigns a code segment number to each application request from the multiple different code segment numbers corresponding to the time information identified at the same time, and generates a time code segment of the regulatory code applied for by the application request based on the time information and the code segment number, thereby ensuring that the time code segments of multiple regulatory codes applied at the same time are different, thereby avoiding duplication of multiple regulatory codes applied at the same time.
[0129] Fig.10 This is a flowchart of a method for generating a supervision code provided in Embodiment 6 of the present disclosure, such as Fig.10 As shown, in Fig. 9 Based on the illustrated embodiment, the method of step S603 includes the following steps:
[0130] Step S71: Determine whether the smallest code segment number among the M different code segment numbers has been assigned to a time code segment.
[0131] For example, there are 1000 code segment numbers corresponding to 3:44:55:666 on January 22, 2016, and the 1000 code segment numbers are from 000 to 999. It is determined whether the smallest code segment number 000 among the 1000 code segment numbers has been assigned to the time code segment.
[0132] Step S72: If the minimum code segment number has been assigned to a time code segment, determine the largest first code segment number that has been assigned to the time code segment among the M different code segment numbers, and store the first code segment number in the code segment number table.
[0133] If 000 has been assigned to the time code segment, determine the largest first code segment number assigned to the time code segment among the 1000 code segment numbers. For example, if 001, 002, 003, and 004 among the 1000 code segment numbers have all been assigned to the time code segment, then the largest first code segment number assigned to the time code segment is 004, and 004 is stored in the code segment number table.
[0134] Step S73, traverse N application requests, obtain the first code segment number stored in the code segment number table, assign the next code segment number of the first code segment number to the currently traversed application request, and store the next code segment number in the code segment number table.
[0135] For example, the number N of application requests corresponding to 3:44:55:666 milliseconds on January 22, 2016 is 4, and the four application requests are traversed, specifically, from the application request sent by the application device 11 to the application request sent by the application device 14; for example, the application request currently traversed is the application request sent by the application device 11, and the first code segment number 004 is obtained from the code segment number table. The first code segment number 004 indicates that 004 has been assigned to the time code segment, and the next code segment number of 004 is assigned to the application request sent by the application device 11. The next code segment number of 004 can be 005, and 005 is stored in the code segment number table. At this time, the first code segment number stored in the code segment number table is updated to 005.
[0136] When traversing the application request sent by the application device 12, the first code segment number 005 is obtained from the code segment number table, the next code segment number 006 of 005 is assigned to the application request sent by the application device 12, and 006 is stored in the code segment number table. At this time, the first code segment number stored in the code segment number table is updated to 006. Repeat the above steps until the traversal of the application request sent by the application device 14 is completed.
[0137] In this embodiment, each time information corresponds to multiple different code segment numbers, and multiple different code segment numbers can identify multiple concurrent application requests received by the traceability platform at the same time. The traceability platform traverses each application request, assigns a different code segment number to each application request, and generates a time code segment of the regulatory code applied for by the application request based on the time information and the code segment number, thereby ensuring that the time code segments of multiple regulatory codes applied for at the same time are different, thereby avoiding duplication of multiple regulatory codes applied for at the same time.
[0138] Fig.11 This is a flowchart of a method for generating a supervision code provided in Embodiment 7 of the present disclosure, such as Fig.11 As shown, in Fig. 9 Based on the illustrated embodiment, the method of step S603 includes the following steps:
[0139] Step S81: Determine whether the smallest code segment number among the M different code segment numbers has been assigned to a time code segment.
[0140] Step S81 is consistent with step S71, and the specific method will not be repeated here.
[0141] Step S82: If the minimum code segment number is not assigned to a time code segment, the minimum code segment number is assigned to one of the N application requests, and the minimum code segment number is stored in a code segment number table.
[0142] If the smallest code segment number 000 among the 1000 code segment numbers is not allocated to the time code segment, 000 is allocated to one of the four application requests in the above-mentioned fourth embodiment, such as the application request sent by the application device 11, and 000 is stored in the code segment number table.
[0143] Step S83, traverse the remaining N-1 application requests, obtain the largest first code segment number stored in the code segment number table, assign the next code segment number of the first code segment number to the currently traversed application request, and store the next code segment number in the code segment number table.
[0144] Traverse the remaining three application requests, from the application request sent by the application device 12 to the application request sent by the application device 14; for example, the application request currently traversed is the application request sent by the application device 12, and the first code segment number 000 is obtained from the code segment number table. The first code segment number 000 indicates that 000 has been assigned to the time code segment, and the next code segment number of 000 is assigned to the application request sent by the application device 12. The next code segment number of 000 can be 001, and 001 is stored in the code segment number table. At this time, the first code segment number stored in the code segment number table is updated to 001.
[0145] When traversing the application request sent by the application device 13, the first code segment number 001 is obtained from the code segment number table, the next code segment number 002 of 001 is assigned to the application request sent by the application device 13, and 002 is stored in the code segment number table. At this time, the first code segment number stored in the code segment number table is updated to 002. Repeat the above steps until the traversal of the application request sent by the application device 14 is completed.
[0146] In this embodiment, each time information corresponds to multiple different code segment numbers, and multiple different code segment numbers can identify multiple concurrent application requests received by the traceability platform at the same time. The traceability platform traverses each application request, assigns a different code segment number to each application request, and generates a time code segment of the regulatory code applied for by the application request based on the time information and the code segment number, thereby ensuring that the time code segments of multiple regulatory codes applied for at the same time are different, thereby avoiding duplication of multiple regulatory codes applied for at the same time.
[0147] Fig.12 This is a flowchart of the method for generating a supervision code provided in the eighth embodiment of the present disclosure. This embodiment can Fig.10 or Fig.11 Based on the embodiment shown, Fig.12 As shown, optional, in Fig.10 Based on the illustrated embodiment, the method comprises the following steps:
[0148] Step S71, determining whether the smallest code segment number among the M different code segment numbers has been assigned to a time code segment;
[0149] Step S72: if the minimum code segment number has been assigned to a time code segment, determine the largest first code segment number that has been assigned to the time code segment among the M different code segment numbers, and store the first code segment number in a code segment number table;
[0150] Step S73, traverse N application requests and obtain the largest first code segment sequence number stored in the code segment sequence number table.
[0151] For example, the largest first code segment number stored in the code segment sequence number table is 996. The above four application requests are traversed, from the application request sent by the application device 11 to the application request sent by the application device 14. For example, the application request currently traversed is the application request sent by the application device 11. The first code segment number 996 is obtained from the code segment sequence number table.
[0152] Step S74: determine whether the first code segment sequence number is the same as the largest second code segment sequence number among the M different code segment sequence numbers.
[0153] The largest second code segment number among the 1000 different code segment numbers in the above embodiment is 999. After the traceability platform obtains the first code segment number 996 from the code segment number table, it determines whether the first code segment number is the same as the second code segment number.
[0154] Step S75: If the first code segment sequence number is different from the second code segment sequence number, the next code segment sequence number of the first code segment sequence number is assigned to the currently traversed application request.
[0155] Since the first code segment sequence number 996 and the second code segment sequence number 999 are different, the next code segment sequence number 997 of the first code segment sequence number 996 is assigned to the currently traversed application request, such as the application request sent by the application device 11, and 997 is stored in the code segment sequence number table. At this time, the first code segment sequence number stored in the code segment sequence number table is updated to 997.
[0156] When the tracing platform traverses the application request sent by the application device 12, step S73 is repeated to obtain the first code segment number 997 from the code segment number table, assign 997 to the currently traversed application request, such as the application request sent by the application device 12, and store 998 in the code segment number table. At this time, the first code segment number stored in the code segment number table is updated to 998. Similarly, the code segment number assigned to the application request sent by the application device 13 is 999, and the first code segment number stored in the code segment number table is updated to 999.
[0157] When the tracing platform traverses the application request sent by the application device 14, step S73 is repeated to obtain the first code segment number 999 from the code segment number table. Since 999 is the largest code segment number among 1000 different code segment numbers, it means that 1000 different code segment numbers have been allocated to different application requests. Since the tracing platform simultaneously receives the application requests sent by the application devices 11, 12, 13, and 14 at 3:44:55:666 on January 22, 2016, a code segment number is obtained from the 1000 different code segment numbers corresponding to 3:44:55:667 on January 22, 2016, which is the next moment after 3:44:55:666 on January 22, 2016, i.e., 3:44:55:667 on January 22, 2016, and the code segment number is allocated to the application request sent by the application device 14.
[0158] In this embodiment, the largest first code segment number assigned to the time code segment is compared with the largest second code segment number among the multiple code segment numbers corresponding to the time information. If the first code segment number is different from the second code segment number, indicating that the multiple code segment numbers corresponding to the time information have not all been assigned to the time code segment, the next code segment number after the first code segment number is assigned to the currently traversed application to avoid the code segment number assigned to the currently traversed application exceeding the upper limit value among the multiple code segment numbers.
[0159] Fig.13 This is a flowchart of the method for generating a supervision code provided in the ninth embodiment of the present disclosure. Fig.10 or Fig.11 Based on the embodiment shown, Fig.13 As shown, optional, in Fig.11 Based on the illustrated embodiment, the method comprises the following steps:
[0160] Step S81: Determine whether the smallest code segment number among the M different code segment numbers has been assigned to a time code segment.
[0161] Step S82: If the minimum code segment number is not assigned to a time code segment, the minimum code segment number is assigned to one of the N application requests, and the minimum code segment number is stored in a code segment number table.
[0162] If the smallest code segment number 000 among the 1000 code segment numbers is not allocated to the time code segment, 000 is allocated to one of the four application requests in the above-mentioned fourth embodiment, such as the application request sent by the application device 11, and 000 is stored in the code segment number table.
[0163] Step S83, traverse the remaining N-1 application requests, and obtain the largest first code segment sequence number stored in the code segment sequence number table.
[0164] The remaining three application requests are traversed, from the application request sent by the application device 12 to the application request sent by the application device 14. For example, the application request sent by the application device 12 is currently traversed, and the largest first code segment sequence number 000 stored in the code segment sequence number table is obtained.
[0165] Step S84, comparing the next code segment number of the first code segment number with the maximum code segment number currently stored in the code segment number table;
[0166] In this embodiment, the same code segment number may be assigned to multiple different application requests. For example, the next code segment number 001 of the first code segment number 000 may be assigned to both the application request sent by the application device 12 and the application request sent by the application device 13. After 001 is assigned to the application request sent by the application device 12, 001 needs to be stored in the code segment number table. After 001 is assigned to the application request sent by the application device 13, 001 needs to be stored in the code segment number table again, that is, 001 will be repeatedly stored in the code segment number table. In order to avoid the same code segment number being assigned to multiple different application requests, before 001 is stored in the code segment number table, concurrent verification is performed. Specifically, 001 to be stored in the code segment number table is compared with the maximum code segment number currently stored in the code segment number table.
[0167] Step S85: If the next code segment number of the first code segment number is different from the maximum code segment number currently stored in the code segment number table, the next code segment number of the first code segment number is assigned to the currently traversed application request, and the next code segment number is stored in the code segment number table.
[0168] If the next code segment number of the first code segment number, such as 001, is different from the maximum code segment number currently stored in the code segment number table, that is, the maximum code segment number currently stored in the code segment number table is not 001, indicating that 001 has not been assigned to other application requests, then 001 will be assigned to the currently traversed application request, such as the application request sent by the application device 12, and 001 will be stored in the code segment number table.
[0169] In addition, if the next code segment number of the first code segment number is the same as the maximum code segment number currently stored in the code segment number table, that is, the maximum code segment number currently stored in the code segment number table is 001, indicating that 001 has been assigned to other application requests, then at the next moment of 3:44:55:666 milliseconds on January 22, 2016, that is, 3:44:55:667 milliseconds on January 22, 2016, a code segment number is obtained from the 1000 different code segment numbers corresponding to the next moment of 3:44:55:667 milliseconds on January 22, 2016, and the code segment number is assigned to the currently traversed application request, such as the application request sent by the application device 12.
[0170] In this embodiment, the code segment number to be stored in the code segment number table is compared with the maximum code segment number currently stored in the code segment number table. If the two are different, it means that the code segment number to be stored in the code segment number table has not been allocated to other application requests. By storing the code segment number before the code segment number table, concurrent verification is performed to avoid repeated allocation of the same code segment number to multiple application requests.
[0171] Fig.14 This is a flowchart of a method for generating a supervision code provided in Embodiment 10 of the present disclosure. The method comprises the following steps:
[0172] Step S1001: Receive an application request sent by an application device.
[0173] Step S1002: Determine the number of application requests received at the time identified by the time information.
[0174] The time information is the time information when the traceability platform receives the application request in step S402. The number of application requests received at the moment identified by the time information is N, where N is greater than 1. The time information corresponds to M different code segment numbers, where M is less than N.
[0175] In this embodiment, the number of application requests received by the traceability platform at 3:44:55:666 am on January 22, 2016 is greater than the number of code segment numbers corresponding to 3:44:55:666 am on January 22, 2016. For example, there are 1000 code segment numbers corresponding to 3:44:55:666 am on January 22, 2016. The number N of application requests received by the traceability platform at 3:44:55:666 am on January 22, 2016 is greater than 1000.
[0176] Step S1003: Determine the time code segments corresponding to M application requests among the N application requests according to the time information and the M different code segment numbers, each time code segment includes the time information and a code segment number.
[0177] Optionally, each time information corresponds to 1000 code segment serial numbers. The traceability platform receives 1005 application requests at 3:44:55:666 on January 22, 2016. Then, according to the time information 3:44:55:666 on January 22, 2016 and the 1000 code segment serial numbers, for example, from 000-999, 1000 time code segments are generated, each time code segment includes 20160122034455666 and a code segment serial number from 000-999, and the 1000 time code segments are allocated to 1000 application requests among the 1005 application requests.
[0178] Step S1004: Add a preset time offset to the time information to generate second time offset information.
[0179] A preset time offset, for example, 3 milliseconds, is added to the time information of January 22, 2016 at 3:44:55:666 milliseconds to generate second time offset information of January 22, 2016 at 3:44:55:669 milliseconds.
[0180] Step S1005: Determine, according to the second time offset information, time code segments corresponding to the application requests other than the M application requests in the N application requests.
[0181] Optionally, the second time offset information corresponds to M different code segment numbers. Determining the time code segments corresponding to the application requests other than the M application requests among the N application requests according to the second time offset information includes: obtaining (NM) different code segment numbers from the M different code segment numbers, (NM) being greater than 0; and determining the time code segments corresponding to the application requests other than the M application requests among the N application requests according to the second time offset information and the (NM) different code segment numbers.
[0182] Similarly, the second time offset information January 22, 2016 at 3:44:55 669 milliseconds corresponds to 1000 code segment numbers, for example, from 000-999. Five code segment numbers are selected from the 1000 code segment numbers corresponding to the second time offset information, for example, 001, 002, 003, 004, and 005. According to the second time offset information January 22, 2016 at 3:44:55 669 milliseconds and 001, 002, 003, 004, and 005, 4. 005 generates 5 time code segments, which are 20160122034455669001, 20160122034455669002, 20160122034455669003, 20160122034455669004, and 20160122034455669005. The 5 time code segments are allocated to the remaining 5 application requests in the 1005 application requests. Step S1006: Generate a supervision code at least according to the time code segments.
[0183] Step S1007: Send the supervision code to the application device.
[0184] Step S1006 is consistent with step S203, and step S1007 is consistent with step S204. The specific method will not be repeated here.
[0185] In this embodiment, each time information corresponds to a plurality of different code segment numbers, and the plurality of different code segment numbers can identify a plurality of concurrent application requests received by the traceability platform at the same time. When the number of the plurality of concurrent application requests received by the traceability platform at the same time is greater than the plurality of different code segment numbers corresponding to the time, a preset time delay is added on the basis of the time, and the code segment number of the application request is determined according to the time information after the delay, and the time code segment of the regulatory code applied for by the application request is generated according to the time information after the delay and the code segment number, thereby ensuring that the time code segments of the plurality of regulatory codes applied for at the same time are different, thereby avoiding duplication of the plurality of regulatory codes applied for at the same time.
[0186] Fig.15 This is a flowchart of a method for generating a supervision code provided in the eleventh embodiment of the present disclosure. The method comprises the following steps:
[0187] Step S1101: Receive an application request sent by an application device.
[0188] The application request includes the time information, and the time information is the time information set by the user through the application device.
[0189] In this embodiment, the time information corresponding to the application request is the time information set on the traceability platform after the personnel of the production enterprise log in to the traceability platform through the application device. For example, the production enterprise plans to sell the goods on January 22, 2016, and applies for the supervision code of the goods on January 1, 2016. Then, 3:44:55:666 milliseconds on January 22, 2016 is set on the traceability platform, indicating that the production enterprise plans to apply for a time code segment associated with 3:44:55:666 milliseconds on January 22, 2016.
[0190] Step S1102: query a preset relationship table according to the time information, wherein the relationship table includes historical time information, and the historical time information is time information included in historical application requests received before receiving the application request.
[0191] In this embodiment, the historical time information is the time information included in the historical application requests received before receiving the application request. For example, the tracing platform has received the application requests sent by the application device 11 and the application device 12 before receiving the application request sent by the application device 13. Then the application requests sent by the application device 11 and the application device 12 are historical application requests. The historical application requests include historical time information, and the historical time information is stored in the relationship table in sequence.
[0192] When the tracing platform receives the application request sent by the application device 13, the preset relationship table is queried according to the time information in the application request, such as 3:44:55:666 am on January 22, 2016. The relationship table stores the historical time information respectively included in the historical application requests sent by the application device 11 and the application device 12.
[0193] Step S1103: Determine whether there is historical time information matching the time information in the preset relationship table. If there is historical time information matching the time information in the preset relationship table, execute steps S1104 to S1106; if there is no historical time information matching the time information in the preset relationship table, execute steps S1107 and S1108.
[0194] The tracing platform queries the preset relationship table according to the time information included in the application request sent by the application device 13, such as 3:44:55:666 AM on January 22, 2016, to determine whether 3:44:55:666 AM on January 22, 2016 is stored in the relationship table.
[0195] Step S1104: adding a preset time offset to the time information to generate third time offset information, wherein the third time offset information does not match the historical time information in the preset relationship table;
[0196] If there is time information matching 3:44:55:666 AM on January 22, 2016 in the relationship table, indicating that the time information 3:44:55:666 AM on January 22, 2016 has been used to generate the time code segment, then a preset time offset, for example 4 milliseconds, is added to the time information 3:44:55:666 AM on January 22, 2016 to generate third time offset information 3:44:55:670 AM on January 22, 2016, and the relationship table is queried based on the third time offset information 3:44:55:670 AM on January 22, 2016, to continue to determine whether there is historical time information matching the third time offset information in the relationship table.
[0197] Step S1105: determine a time code segment according to the third time offset information, wherein the time code segment includes the third time offset information.
[0198] If there is no historical time information matching the third time offset information in the relationship table, the time code segment is determined according to the third time offset information 3:44:55:670 on January 22, 2016, and the time code segment may be 20160122034455670.
[0199] Step S1106: Store the third time offset information into the preset relationship table.
[0200] In addition, the tracing platform also stores the third time offset information 3:44:55:670 milliseconds on January 22, 2016 in the relationship table, indicating that the time information 3:44:55:670 milliseconds on January 22, 2016 has been used to generate the time code segment.
[0201] Step S1107: Determine a time code segment according to the time information included in the application request, and the time code segment includes the time information. If there is no time information matching 3:44:55:666 on January 22, 2016 in the relationship table, the traceability platform determines the time code segment according to the time information 3:44:55:666 on January 22, 2016, and the time code segment may be 20160122034455666.
[0202] Step S1108: Store the time information into the preset relationship table.
[0203] In addition, the traceability platform also stores the time information 3:44:55:666 on January 22, 2016 in the relationship table, indicating that the time information 3:44:55:666 on January 22, 2016 has been used to generate the time code segment.
[0204] Step S1109: Generate a supervision code at least according to the time code segment.
[0205] Step S1110: Send the supervision code to the application device.
[0206] Step S1109 is consistent with step S203, and step S1110 is consistent with step S204. The specific methods are not repeated here.
[0207] In this embodiment, the application request sent by the application device also includes time information, which is the time information input by the user through the application device. The traceability platform queries the relationship table based on the time information to determine whether the time information included in the application request has been used to allocate the time code segment, so as to avoid duplication of the time code segments allocated to different application requests.
[0208] Fig.16 This is a flowchart of a method for generating a supervision code provided in Embodiment 12 of the present disclosure. The method comprises the following steps:
[0209] Step S1101: Receive an application request sent by an application device.
[0210] The application request includes the time information, and the time information is the time information set by the user through the application device.
[0211] In this embodiment, the time information corresponding to the application request is the time information set on the traceability platform after the personnel of the production enterprise log in to the traceability platform through the application device. For example, the production enterprise plans to sell the goods on January 22, 2016, and applies for the supervision code of the goods on January 1, 2016. Then, 3:44:55:666 milliseconds on January 22, 2016 is set on the traceability platform, indicating that the production enterprise plans to apply for a time code segment associated with 3:44:55:666 milliseconds on January 22, 2016.
[0212] Step S1102: query a preset relationship table according to the time information, wherein the relationship table includes historical time information, and the historical time information is time information included in historical application requests received before receiving the application request;
[0213] In this embodiment, the historical time information is the time information included in the historical application requests received before receiving the application request. For example, the tracing platform has received the application requests sent by the application device 11 and the application device 12 before receiving the application request sent by the application device 13. Then the application requests sent by the application device 11 and the application device 12 are historical application requests. The historical application requests include historical time information, and the historical time information is stored in the relationship table in sequence.
[0214] When the tracing platform receives the application request sent by the application device 13, the preset relationship table is queried according to the time information in the application request, such as 3:44:55:666 am on January 22, 2016. The relationship table stores the historical time information respectively included in the historical application requests sent by the application device 11 and the application device 12.
[0215] Step S1103: Determine whether there is historical time information matching the time information in the preset relationship table. If there is historical time information matching the time information in the preset relationship table, execute steps S1204 to S1206; if there is no historical time information matching the time information in the preset relationship table, execute steps S1107 and S1108.
[0216] The tracing platform queries the preset relationship table according to the time information included in the application request sent by the application device 13, such as 3:44:55:666 AM on January 22, 2016, to determine whether 3:44:55:666 AM on January 22, 2016 is stored in the relationship table.
[0217] In addition, the preset relationship table also includes code segment serial numbers. One piece of historical time information corresponds to one code segment serial number, and the code segment serial numbers corresponding to a plurality of identical historical time information respectively increase continuously.
[0218] In this embodiment, the specific structure of the relationship table may be as shown in Table 1:
[0219] Table 1
[0220] Historical time information Code segment number January 22, 2016 3:44:55 666 milliseconds 001 January 22, 2016 3:44:55 666 milliseconds 002
[0221] When the tracing platform receives the application request sent by the application device 13, the preset relationship table is queried according to the time information in the application request, such as 3:44:55:666 am on January 22, 2016. The relationship table stores the historical time information respectively included in the historical application requests sent by the application device 11 and the application device 12. As shown in Table 1, the historical time information respectively included in the historical application requests sent by the application device 11 and the application device 12 is 3:44:55:666 am on January 22, 2016. One historical time information corresponds to one code segment number, and the code segment numbers corresponding to multiple identical historical time information increase continuously.
[0222] Step S1204: Determine the next code segment number of the maximum code segment number according to the maximum code segment number corresponding to the historical time information matching the time information;
[0223] According to Table 1, the maximum code segment number corresponding to the historical time information matching the time information of January 22, 2016 at 3:44:55:666 is 002, and the next code segment number of the maximum code segment number is determined to be 003.
[0224] Step S1205: determining a time code segment according to the time information and the next code segment sequence number, wherein the time code segment includes the time information and the next code segment sequence number;
[0225] According to the time information of 3:44:55:666 milliseconds and 003 on January 22, 2016, it can be determined that the time code segment in the supervision code applied for by the application request sent by the application device 13 is 20160122034455666003.
[0226] Step S1206: Store the corresponding relationship between the time information and the next code segment sequence number in the preset relationship table.
[0227] The corresponding relationship between the time information 3:44:55:666 milliseconds on January 22, 2016 and 003 is stored in the preset relationship table, and the following Table 2 is obtained:
[0228] Table 2
[0229] Historical time information Code segment number January 22, 2016 3:44:55 666 milliseconds 001 January 22, 2016 3:44:55 666 milliseconds 002 January 22, 2016 3:44:55 666 milliseconds 003
[0230] Step S1107: Determine a time code segment according to the time information included in the application request, and the time code segment includes the time information. If there is no time information matching 3:44:55:666 on January 22, 2016 in the relationship table, the traceability platform determines the time code segment according to the time information 3:44:55:666 on January 22, 2016, and the time code segment may be 20160122034455666.
[0231] Step S1108: Store the time information into the preset relationship table.
[0232] In addition, the traceability platform also stores the time information 3:44:55:666 on January 22, 2016 in the relationship table, indicating that the time information 3:44:55:666 on January 22, 2016 has been used to generate the time code segment.
[0233] Step S1109: Generate a supervision code at least according to the time code segment.
[0234] Step S1110: Send the supervision code to the application device.
[0235] Step S1109 is consistent with step S203, and step S1110 is consistent with step S204. The specific methods are not repeated here.
[0236] In this embodiment, the application request sent by the application device also includes time information, which is the time information input by the user through the application device. The traceability platform queries the relationship table based on the time information to determine whether the time information included in the application request has been used to allocate the time code segment, so as to avoid duplication of the time code segments allocated to different application requests.
[0237] Fig.17 This is a flowchart of a method for generating a supervision code provided in Embodiment 13 of the present disclosure. The method comprises the following steps:
[0238] Step S1301: receiving an application request sent by an application device, wherein the application request is used to apply for a supervision code, and the application request includes a commodity name and the number of supervision codes required to be applied for.
[0239] Step S1302: Determine the prefix of the supervision code according to the name of the goods.
[0240] Optionally, the type of goods is determined based on the name of the goods; and the prefix of the regulatory code is determined based on the type.
[0241] Step S1302 is consistent with step S31, and the specific method will not be repeated here.
[0242] Step S1303: Determine a time code segment at least according to the time information associated with the application request.
[0243] Optionally, the time code segment is determined at least based on the time information when the application request is received; or, the time code segment is determined at least based on the time information when the application request is processed; or, the application request includes the time information, and the time information is the time information set by the user through the application device, and the time code segment is determined at least based on the time information included in the application request.
[0244] The time code segment is determined at least based on the time information when the application request is received; or, the time code segment is determined at least based on the time information when the application request is processed; or, the method for determining the time code segment at least based on the time information included in the application request is consistent with the above embodiment, and the specific process will not be repeated here.
[0245] Step S1304: Determine the serial number of each regulatory code according to the number of regulatory codes required to be applied for, wherein the serial number of each regulatory code increases continuously.
[0246] Step S1305: verify the sequence consisting of the prefix, the time code segment, and the serial number to generate a check digit of the supervision code.
[0247] Step S1306: The prefix, the time code segment, the serial number, and the check digit constitute the supervision code.
[0248] Step S1307: Send the supervision code to the applying device.
[0249] Step S1304 is consistent with step S32, step S1305 is consistent with step S33, and step S1306 is consistent with step S34. The specific methods are not repeated here.
[0250] In this embodiment, the time code segment is associated with the time information. Since the time information is a continuously changing information, the time information will continue to increase with the increase of time, ensuring that the time code segment can be applied without restriction. The supervision code is generated based on the time code segment, thereby realizing that the supervision code can be applied without restriction.
[0251] Fig.18 This is a flowchart of a method for generating a supervision code provided in Embodiment 14 of the present disclosure. Fig.17 Based on the illustrated embodiment, the method comprises the following steps:
[0252] Step S1401: receiving an application request sent by an application device, wherein the application request is used to apply for a supervision code, and the application request includes a commodity name and the number of supervision codes required to be applied for.
[0253] Step S1401 is consistent with step S1301, and the specific method will not be repeated here.
[0254] Step S1402: Determine the prefix of the supervision code according to the name of the goods.
[0255] Step S1402 is consistent with step S1302, and the specific method will not be repeated here.
[0256] Step S1403: Determine the number of application requests received at the time identified by the time information.
[0257] The time information is the time information when the traceability platform receives the application request in step S402. The number of application requests received at the time identified by the time information is N, where N is greater than 1.
[0258] Step S1403 is consistent with step S502, and the specific method will not be repeated here.
[0259] Step S1404: Add N different time offsets to the time information to generate N first time offset information. One application request corresponds to one first time offset information.
[0260] Step S1404 is consistent with step S503, and the specific method will not be repeated here.
[0261] Step S1405: Determine the time code segment according to the first time offset information corresponding to each application request, wherein the time code segment includes the first time offset information.
[0262] Step S1405 is consistent with step S504, and the specific method will not be repeated here.
[0263] Step S1406: Determine the serial number of each regulatory code according to the number of regulatory codes required to be applied for, wherein the serial number of each regulatory code increases continuously.
[0264] Step S1407: verify the sequence consisting of the prefix, the time code segment, and the serial number to generate a check digit of the supervision code.
[0265] Step S1408: The prefix, the time code segment, the serial number, and the check digit constitute the supervision code.
[0266] Step S1409: Send the supervision code to the application device.
[0267] Step S1406 is consistent with step S32, step S1407 is consistent with step S33, and step S1408 is consistent with step S34. The specific methods are not repeated here.
[0268] In this embodiment, when the traceability platform receives multiple application requests at the same time, the traceability platform adds multiple different time offsets to the time information corresponding to the time, generates multiple first time offset information, one application request corresponds to one first time offset information, and generates the time code segment of the regulatory code applied for by each application request according to the first time offset information corresponding to the application request, thereby ensuring that the time code segments of multiple regulatory codes applied for at the same time are different, thereby avoiding duplication of multiple regulatory codes applied for at the same time.
[0269] Fig.19 This is a flowchart of a method for generating a supervision code provided in Embodiment 15 of the present disclosure. Fig.17 Based on the illustrated embodiment, the method comprises the following steps:
[0270] Step S1501: receiving an application request sent by an application device, wherein the application request is used to apply for a supervision code, and the application request includes a commodity name and the number of supervision codes required to be applied for.
[0271] Step S1501 is consistent with step S1301, and the specific method will not be repeated here.
[0272] Step S1502: Determine the prefix of the supervision code according to the name of the goods.
[0273] Step S1502 is consistent with step S1302, and the specific method will not be repeated here.
[0274] Step S1503: Determine the number of application requests received at the time identified by the time information.
[0275] The time information is the time information when the traceability platform described in step S402 receives the application request. The number of application requests received at the moment identified by the time information is N, and N is greater than 1. The time information corresponds to M different code segment numbers, and M is greater than or equal to N.
[0276] Step S1503 is consistent with step S602, and the specific method will not be repeated here.
[0277] Step S1504: Obtain N different code segment numbers from the M different code segment numbers.
[0278] Step S1504 is consistent with step S603, and the specific method will not be repeated here.
[0279] Step S1505: Generate N different time code segments according to the time information and the N different code segment numbers, each time code segment includes the time information and a code segment number among the N different code segment numbers, and one application request corresponds to one time code segment.
[0280] Step S1505 is consistent with step S604, and the specific method will not be repeated here.
[0281] Step S1506: Determine the serial number of each regulatory code according to the number of regulatory codes to be applied for, wherein the serial number of each regulatory code increases continuously.
[0282] Step S1507: verify the sequence consisting of the prefix, the time code segment, and the serial number to generate a check digit of the supervision code.
[0283] Step S1508: The prefix, the time code segment, the serial number, and the check digit constitute the supervision code.
[0284] Step S1509: Send the supervision code to the application device.
[0285] Step S1506 is consistent with step S32, step S1507 is consistent with step S33, and step S1508 is consistent with step S34. The specific methods are not repeated here.
[0286] In this embodiment, each time information corresponds to multiple different code segment numbers, and the multiple different code segment numbers can identify multiple concurrent application requests received by the traceability platform at the same time. The traceability platform assigns a code segment number to each application request from the multiple different code segment numbers corresponding to the time information identified at the same time, and generates a time code segment of the regulatory code applied for by the application request based on the time information and the code segment number, thereby ensuring that the time code segments of multiple regulatory codes applied at the same time are different, thereby avoiding duplication of multiple regulatory codes applied at the same time.
[0287] Fig. 20 This is a flowchart of a method for generating a supervision code provided in Embodiment 16 of the present disclosure. Fig.17 Based on the illustrated embodiment, the method comprises the following steps:
[0288] Step S1601: receiving an application request sent by an application device, wherein the application request is used to apply for a supervision code, and the application request includes a commodity name and the number of supervision codes required to be applied for.
[0289] Step S1601 is consistent with step S1301, and the specific method will not be repeated here.
[0290] Step S1602: Determine the prefix of the supervision code according to the name of the goods.
[0291] Step S1602 is consistent with step S1302, and the specific method will not be repeated here.
[0292] Step S1603: Determine the number of application requests received at the time identified by the time information.
[0293] The time information is the time information when the traceability platform receives the application request in step S402. The number of application requests received at the moment identified by the time information is N, where N is greater than 1. The time information corresponds to M different code segment numbers, where M is less than N.
[0294] Step S1603 is consistent with step S1002, and the specific method will not be repeated here.
[0295] Step S1604: Determine the time code segments corresponding to M application requests among the N application requests according to the time information and the M different code segment numbers, each time code segment including the time information and a code segment number.
[0296] Step S1604 is consistent with step S1003, and the specific method will not be repeated here.
[0297] Step S1605: Add a preset time offset to the time information to generate second time offset information.
[0298] Step S1605 is consistent with step S1004, and the specific method will not be repeated here.
[0299] Step S1606: Determine, according to the second time offset information, time code segments corresponding to the application requests other than the M application requests in the N application requests.
[0300] Step S1606 is consistent with step S1005, and the specific method will not be repeated here.
[0301] Step S1607: Determine the serial number of each regulatory code according to the number of regulatory codes required to be applied for, wherein the serial number of each regulatory code increases continuously.
[0302] Step S1608: verify the sequence consisting of the prefix, the time code segment, and the serial number to generate a check digit of the supervision code.
[0303] Step S1609: The prefix, the time code segment, the serial number, and the check digit constitute the supervision code.
[0304] Step S1610: Send the supervision code to the application device.
[0305] Step S1607 is consistent with step S32, step S1608 is consistent with step S33, and step S1609 is consistent with step S34. The specific methods are not repeated here.
[0306] In this embodiment, each time information corresponds to a plurality of different code segment numbers, and the plurality of different code segment numbers can identify a plurality of concurrent application requests received by the traceability platform at the same time. When the number of the plurality of concurrent application requests received by the traceability platform at the same time is greater than the plurality of different code segment numbers corresponding to the time, a preset time delay is added on the basis of the time, and the code segment number of the application request is determined according to the time information after the delay, and the time code segment of the regulatory code applied for by the application request is generated according to the time information after the delay and the code segment number, thereby ensuring that the time code segments of the plurality of regulatory codes applied for at the same time are different, thereby avoiding duplication of the plurality of regulatory codes applied for at the same time.
[0307] Fig.21 This is a flowchart of a method for generating a supervision code provided in Embodiment 17 of the present disclosure. The method comprises the following steps:
[0308] Step S1701: Send an application request to a server, wherein the application request is used to apply for a regulatory code, and the application request includes the name of the goods and the number of regulatory codes required to be applied for.
[0309] The execution subject of this embodiment is the application device, which can be a terminal device such as a mobile terminal or a computer. The application device sends an application request to the server, which can be the traceability platform described in the above embodiment. The application request is used to apply for a supervision code, such as Figure 3 As shown, manufacturer A can apply for a supervision code from the traceability platform through application device 11, manufacturer B can apply for a supervision code from the traceability platform through application device 12, manufacturer C can apply for a supervision code from the traceability platform through application device 13, and manufacturer D can apply for a supervision code from the traceability platform through application device 14. The application request includes the name of the goods and the number of supervision codes required to be applied for.
[0310] Step S1702: Receive and display the supervision code fed back by the server.
[0311] The regulatory code is composed of a prefix, a time code segment, a serial number, and a check digit. The prefix is determined by the server according to the name of the goods. The time code segment is determined by the server according to the time information associated with the application request. The serial number of each regulatory code is determined by the server according to the number of regulatory codes required to be applied for. The serial number of each regulatory code increases continuously. The check digit is generated by the server verifying the sequence composed of the prefix, the time code segment, and the serial number.
[0312] The traceability platform determines the prefix of the regulatory code according to the name of the goods; determines the time code segment according to at least the time information associated with the application request; determines the serial number of each regulatory code according to the number of regulatory codes required to be applied for, and the serial number of each regulatory code increases continuously; verifies the sequence composed of the prefix, the time code segment, and the serial number to generate the check digit of the regulatory code; and the prefix, the time code segment, the serial number, and the check digit constitute the regulatory code. The traceability platform feeds back the generated regulatory code to the application device.
[0313] The method by which the traceability platform generates a supervision code based on an application request is consistent with the method in the above embodiment and will not be repeated here.
[0314] In this embodiment, the time code segment is associated with the time information. Since the time information is a continuously changing information, the time information will continue to increase with the increase of time, ensuring that the time code segment can be applied without restriction. The supervision code is generated based on the time code segment, thereby realizing that the supervision code can be applied without restriction.
[0315] Fig. 22 This is a schematic diagram of the structure of the server provided in the first embodiment of the present disclosure. The traceability platform in the above embodiment can be specifically implemented as the server in this implementation, such as Fig. 22 As shown, the server includes a receiving unit and a processing unit.
[0316] The receiving unit is used to receive an application request sent by an application device.
[0317] The processing unit is coupled to the receiving unit and is configured to determine a time code segment based at least on time information associated with the application request.
[0318] In this embodiment, the time code segment is associated with the time information. Since the time information is a continuously changing information, the time information will continue to increase with the increase of time, ensuring that the time code segment can be applied without restriction. The supervision code is generated based on the time code segment, thereby realizing that the supervision code can be applied without restriction.
[0319] exist Fig. 22 Based on the illustrated embodiment, the processing unit is further configured to generate a supervision code at least according to the time code segment.
[0320] The server further comprises a sending unit, which is coupled to the processing unit and is used to send the supervision code to the application device.
[0321] Optionally, the processing unit is specifically used to determine the time code segment based on at least time information when the application request is received.
[0322] Furthermore, the processing unit is further configured to determine the number of application requests received at the time identified by the time information.
[0323] Optionally, the number of application requests received at the moment identified by the time information is N, and N is greater than 1; the processing unit is specifically used to add N different time offsets to the time information, respectively, to generate N first time offset information, and one application request corresponds to one first time offset information; according to the first time offset information corresponding to each application request, the time code segment is determined, and the time code segment includes the first time offset information.
[0324] In addition, in other embodiments, the number of application requests received at the moment identified by the time information is N, where N is greater than 1; the time information corresponds to M different code segment numbers, where M is greater than or equal to N; the processing unit is specifically used to obtain N different code segment numbers from the M different code segment numbers; based on the time information and the N different code segment numbers, N different time code segments are generated, each time code segment including the time information and a code segment number among the N different code segment numbers, and one application request corresponds to one time code segment.
[0325] In addition, in other embodiments, the number of application requests received at the moment identified by the time information is N, where N is greater than 1; the time information corresponds to M different code segment numbers, where M is less than N; the processing unit is specifically used to determine, based on the time information and the M different code segment numbers, the time code segments corresponding to M application requests among the N application requests, each time code segment including the time information and a code segment number; add a preset time offset to the time information to generate second time offset information; and determine, based on the second time offset information, the time code segments corresponding to the application requests other than the M application requests among the N application requests.
[0326] In this embodiment, when the traceability platform receives multiple application requests at the same time, the traceability platform adds multiple different time offsets to the time information corresponding to the time, generates multiple first time offset information, one application request corresponds to one first time offset information, and generates the time code segment of the regulatory code applied for by each application request according to the first time offset information corresponding to the application request, thereby ensuring that the time code segments of multiple regulatory codes applied for at the same time are different, thereby avoiding duplication of multiple regulatory codes applied for at the same time.
[0327] Fig.23 This is a schematic diagram of the structure of the server provided in the second embodiment of the present disclosure. The traceability platform in the above embodiment can be specifically implemented as the server in this implementation, such as Fig.23 As shown, the server includes a receiving unit, a processing unit, and a sending unit.
[0328] The receiving unit is used to receive an application request sent by an application device, wherein the application request is used to apply for a supervision code, and the application request includes a commodity name and the number of supervision codes required to be applied for.
[0329] The processing unit is coupled to the receiving unit and the sending unit, and is used to determine the prefix of the supervision code according to the name of the goods; determine the time code segment according to at least the time information associated with the application request; determine the serial number of each supervision code according to the number of supervision codes required to be applied for, and the serial number of each supervision code increases continuously; verify the sequence composed of the prefix, the time code segment, and the serial number to generate a check digit of the supervision code; and form the supervision code with the prefix, the time code segment, the serial number, and the check digit.
[0330] The sending unit is used to send the supervision code to the application device.
[0331] Optionally, the processing unit is specifically configured to determine the type of goods according to the name of the goods; and determine the prefix of the supervision code according to the type.
[0332] Furthermore, the processing unit is specifically configured to determine the time code segment at least according to time information when the receiving unit receives the application request.
[0333] In addition, in other embodiments, the processing unit is specifically used to determine the time code segment based on at least time information when processing the application request.
[0334] In addition, in other embodiments, the application request includes the time information, and the time information is the time information set by the user through the application device; the processing unit is specifically used to determine the time code segment based on at least the time information included in the application request.
[0335] In addition, the processing unit is further configured to determine the number of application requests received at the time identified by the time information.
[0336] Optionally, the number of application requests received at the moment identified by the time information is N, and N is greater than 1; the processing unit is specifically used to add N different time offsets to the time information, respectively, to generate N first time offset information, and one application request corresponds to one first time offset information; according to the first time offset information corresponding to each application request, the time code segment is determined, and the time code segment includes the first time offset information.
[0337] In addition, in other embodiments, the number of application requests received at the moment identified by the time information is N, where N is greater than 1; the time information corresponds to M different code segment numbers, where M is greater than or equal to N; the processing unit is specifically used to obtain N different code segment numbers from the M different code segment numbers; based on the time information and the N different code segment numbers, N different time code segments are generated, each time code segment including the time information and a code segment number among the N different code segment numbers, and one application request corresponds to one time code segment.
[0338] In addition, in other embodiments, the number of application requests received at the moment identified by the time information is N, where N is greater than 1; the time information corresponds to M different code segment numbers, where M is less than N; the processing unit is specifically used to determine, based on the time information and the M different code segment numbers, the time code segments corresponding to M application requests among the N application requests, each time code segment including the time information and a code segment number; add a preset time offset to the time information to generate second time offset information; and determine, based on the second time offset information, the time code segments corresponding to the application requests other than the M application requests among the N application requests.
[0339] In this embodiment, the time code segment is associated with the time information. Since the time information is a continuously changing information, the time information will continue to increase with the increase of time, ensuring that the time code segment can be applied without restriction. The supervision code is generated based on the time code segment, thereby realizing that the supervision code can be applied without restriction.
[0340] Fig.24 This is a schematic diagram of the structure of the server provided in the third embodiment of the present disclosure. Fig.24 , the server 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the method of steps S301-S903 above.
[0341] The device 1900 may also include a power supply component 1926 configured to perform power management of the device 1900, a wired or wireless network interface 1950 configured to connect the device 1900 to a network, and an input / output (I / O) interface 1958. The device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server™, MacOS X™, Unix™, Linux™, FreeBSD™, or the like.
[0342] Fig.25 This is a schematic diagram of the structure of a terminal device provided in the first embodiment of the present disclosure. The application device in the above embodiment can be specifically implemented as a terminal device in this implementation, such as Fig.25 As shown, the terminal device includes: a transmitter and a receiver.
[0343] The transmitter is used to send an application request to the server, wherein the application request is used to apply for a supervision code, and the application request includes the name of the goods and the number of supervision codes required to be applied for.
[0344] The receiver is used to receive the supervision code fed back by the server.
[0345] The regulatory code is composed of a prefix, a time code segment, a serial number, and a check digit. The prefix is determined by the server according to the name of the goods. The time code segment is determined by the server according to the time information associated with the application request. The serial number of each regulatory code is determined by the server according to the number of regulatory codes required to be applied for. The serial number of each regulatory code increases continuously. The check digit is generated by the server verifying the sequence composed of the prefix, the time code segment, and the serial number.
[0346] like Fig.25 As shown, the terminal device also includes a display coupled to the receiver, for displaying the supervision code fed back by the server.
[0347] Optionally, the time information is the time information when the server receives the application request.
[0348] In addition, in other embodiments, the time information is the time information when the server processes the application request.
[0349] In addition, in other embodiments, the application request also includes the time information, and the time information is the time information set by the user through the application device.
[0350] In this embodiment, the time code segment is associated with the time information. Since the time information is a continuously changing information, the time information will continue to increase with the increase of time, ensuring that the time code segment can be applied without restriction. The supervision code is generated based on the time code segment, thereby realizing that the supervision code can be applied without restriction.
[0351] Fig.26 This is a schematic diagram of the structure of a terminal device provided in Embodiment 2 of the present disclosure, such as Fig.26 As shown, refer to Fig.26 The terminal device 2000 may include one or more of the following components: a processing component 2002 , a memory 2004 , a power component 2006 , a multimedia component 2008 , an audio component 2010 , an input / output (I / O) interface 2012 , a sensor component 2014 , and a communication component 2016 .
[0352] The processing component 2002 generally controls the overall operation of the terminal device 2000, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 2002 may include one or more processors 2020 to execute instructions to complete the above method. In addition, the processing component 2002 may include one or more modules to facilitate the interaction between the processing component 2002 and other components. For example, the processing component 2002 may include a multimedia module to facilitate the interaction between the multimedia component 2008 and the processing component 2002.
[0353] The memory 2004 is configured to store various types of data to support operations on the terminal device 2000. Examples of such data include instructions for any application or method operating on the terminal device 2000, contact data, phone book data, messages, pictures, videos, etc. The memory 2004 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0354] The power supply component 2006 provides power to various components of the terminal device 2000. The power supply component 2006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the terminal device 2000.
[0355] The multimedia component 2008 includes a screen that provides an output interface between the terminal device 2000 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 2008 includes a front camera and / or a rear camera. When the terminal device 2000 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0356] The audio component 2010 is configured to output and / or input audio signals. For example, the audio component 2010 includes a microphone (MIC), and when the terminal device 2000 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 2004 or sent via the communication component 2016. In some embodiments, the audio component 2010 also includes a speaker for outputting audio signals.
[0357] The input / output interface 2012 provides an interface between the processing component 2002 and the peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0358] The sensor assembly 2014 includes one or more sensors for providing various aspects of status assessment for the terminal device 2000. For example, the sensor assembly 2014 can detect the open / closed state of the terminal device 2000, the relative positioning of the components, such as the display and keypad of the terminal device 2000, and the sensor assembly 2014 can also detect the position change of the terminal device 2000 or a component of the terminal device 2000, the presence or absence of contact between the user and the terminal device 2000, the orientation or acceleration / deceleration of the terminal device 2000 and the temperature change of the terminal device 2000. The sensor assembly 2014 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 2014 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 2014 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
[0359] The communication component 2016 is configured to facilitate the communication between the terminal device 2000 and other devices in a wired or wireless manner. The terminal device 2000 can access a wireless airborne based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 2016 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 2016 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0360] In an exemplary embodiment, the terminal device 2000 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above-mentioned methods.
[0361] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 2004 including instructions, and the instructions can be executed by the processor 2020 of the terminal device 2000 to complete the above method. For example, the non-transitory computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk or an optical disk.
[0362] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a terminal device, enables the terminal device to perform a supervision code generation method, the method comprising:
[0363] An application request is sent to a server, wherein the application request is used to apply for a regulatory code, and the application request includes the name of the goods and the number of regulatory codes required to be applied for.
[0364] Receive the supervision code fed back by the server.
[0365] The regulatory code is composed of a prefix, a time code segment, a serial number, and a check digit. The prefix is determined by the server according to the name of the goods. The time code segment is determined by the server according to the time information associated with the application request. The serial number of each regulatory code is determined by the server according to the number of regulatory codes required to be applied for. The serial number of each regulatory code increases continuously. The check digit is generated by the server verifying the sequence composed of the prefix, the time code segment, and the serial number.
[0366] Fig. 27 A schematic diagram of the structure of the supervision code generation system provided in the embodiment of the present disclosure, such as Fig. 27 As shown, the supervision code generation system includes: a server 1 and a terminal device 2. The server can be Figure 22-24 In any of the server embodiments shown, the terminal device may be Fig.25 or Fig.26 The terminal device in the illustrated embodiment.
[0367] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present disclosure.
Claims
1. A method for generating a supervision code, characterized in that: include: The traceability platform receives the application request sent by the application device, wherein the application request includes the name of the goods and the number of regulatory codes required to be applied for; At least determine the time code segment based on the time information set on the traceability platform after the application device logs into the traceability platform; generating a supervision code according to the time code segment; Wherein, generating a supervision code according to the time code segment includes: Determine the prefix of the regulatory code based on the name of the goods; Determine the serial number of each regulatory code according to the number of regulatory codes to be applied for, wherein the serial number of each regulatory code increases continuously; Verifying a sequence consisting of the prefix, the time code segment, and the serial number to generate a check digit of the supervision code; The prefix, the time code segment, the serial number, and the check digit constitute the supervision code.
2. The method according to claim 1, characterized in that After the supervision code is generated according to the time code segment, the method further includes: The supervision code is sent to the application device.
3. The method according to claim 1, characterized in that The time information set on the traceability platform is accurate to milliseconds.
4. The method according to claim 1, characterized in that: Before the traceability platform receives the application request sent by the application device, it also includes: Log in to the traceability platform by applying for equipment; Query the traceability platform for the goods uploaded by the manufacturer of the equipment under application and verified as qualified by the traceability platform; Determine the quantity of the goods, and use the quantity of the goods as the quantity of regulatory codes required to be applied for.
5. The method according to claim 1, characterized in that The supervision code is a digital sequence.
6. The method according to claim 1, characterized in that The method further comprises: before determining the time code segment based on the time information set on the traceability platform after the application device logs in to the traceability platform; Determine the number of application requests associated with the moment identified by the time information.
7. The method according to claim 6, characterized in that The number of application requests associated at the moment identified by the time information is N, where N is greater than 1; The time code segment is determined at least according to the time information set on the traceability platform after the application device logs in to the traceability platform, including: Adding N different time offsets to the time information respectively to generate N first time offset information, where one application request corresponds to one first time offset information; The time code segment is determined according to the first time offset information corresponding to each application request, and the time code segment includes the first time offset information.
8. The method according to claim 6, characterized in that The number of application requests associated at the moment identified by the time information is N, where N is greater than 1; The time information corresponds to M different code segment numbers, where M is greater than or equal to N; The time code segment is determined at least according to the time information set on the traceability platform after the application device logs in to the traceability platform, including: Obtaining N different code segment sequence numbers from the M different code segment sequence numbers; N different time code segments are generated according to the time information and the N different code segment numbers, each time code segment includes the time information and a code segment number among the N different code segment numbers, and one application request corresponds to one time code segment.
9. The method according to claim 8, characterized in that The obtaining N different code segment sequence numbers from the M different code segment sequence numbers includes: Determining whether a minimum code segment sequence number among the M different code segment sequence numbers has been assigned to a time code segment; If the minimum code segment number has been assigned to the time code segment, determine the largest code segment number that has been assigned to the time code segment among the M different code segment numbers, and store the determined largest assigned code segment number as the first code segment number in the code segment number table; Traverse N application requests, obtain the first code segment number stored in the code segment number table, assign the next code segment number of the first code segment number to the currently traversed application request, and store the next code segment number as the first code segment number in the code segment number table.
10. A traceability platform, comprising: A processor, wherein the processor is configured to execute the steps of the method according to any one of claims 1 to 9.
