Stream number processing method and apparatus, and computer device
By automatically updating the serial number level table and the missing number table, the problem of manual recovery after a serial number break is solved, the continuity and sequence of serial numbers are realized, labor costs are reduced, and processing efficiency is improved.
Patent Information
- Application Number
- CN202210636436.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-07
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2042-06-07
AI Technical Summary
In existing technologies, when the serial number of a business document is broken, manual intervention is required to restore it, resulting in high labor costs, cumbersome processing, and a high risk of errors.
By obtaining the request to reclaim missing serial numbers, the coding rule ID and the water level value of the serial number basis item in the serial number water level table are updated. Combined with the serial number increment step and the missing serial number table, the serial number is automatically determined and updated, reducing manual intervention.
It achieves continuity and sequence of serial numbers, reduces labor costs, improves processing efficiency, and simplifies the operation process.
Smart Images

Figure CN115080802B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, in particular to a serial number processing method and device and computer equipment. BACKGROUND
[0002] In most business scenarios, especially in enterprise resource planning (ERP) system business, the serial number of a business document needs to maintain continuity and order. However, reasons such as deletion of a business document or omission of recording may cause the serial number to be broken. The solution is that when a business document is deleted, the business code corresponding to the business document triggers a broken serial number recovery interface to save the serial number in the document code of the business document to a broken serial number table or a broken serial number cache. When a new business document is added next time, the serial number in the new document code is preferentially queried from the broken serial number table or the broken serial number cache. However, due to possible vulnerabilities in the business code corresponding to the business document, or due to the system runtime environment, the broken serial number may not be recovered normally.
[0003] In the prior art, for a business document that allows a user to edit and supplement a document code, the user can manually supplement and modify the serial number in the document code, thereby repairing the broken serial number and ensuring the continuity of the serial number of the business document; for a business document that does not allow a user to edit and supplement a document code, only the system technical support personnel can manually modify the broken serial number table in the background, thereby adding the broken serial number that has not been normally recovered to the broken serial number table, so as to ensure the continuity of the serial number of the business document. Regardless of which way, it needs a large amount of manpower, and the processing process is complicated, inefficient and prone to errors. SUMMARY
[0004] Therefore, it is necessary to provide a serial number processing method, device and computer equipment capable of reducing the manpower cost in view of the above technical problems.
[0005] In a first aspect, the present application provides a serial number processing method. The method comprises:
[0006] A broken serial number recovery request is obtained, the broken serial number recovery request carrying a code rule ID, a serial number basis item value and a broken serial number check starting point value; according to the broken serial number check starting point value, the water level value corresponding to the code rule ID and the serial number basis item value in the serial number water level table is updated; a serial number acquisition request is obtained, the serial number acquisition request carrying a document type and a serial number basis item value; according to the document type, a code rule ID is obtained, according to the code rule ID and the serial number basis item value, a current water level value is obtained, and according to the document type, the code rule ID, the serial number basis item value and the current water level value, a serial number is determined.
[0007] In one of the embodiments, the serial number is determined according to the document type, the coding rule ID, the serial basis item value and the current water level value, comprising: querying the serial number increment step according to the coding rule ID and the coding rule sub-table; obtaining the document business table corresponding to the document type according to the document type; querying M serial numbers corresponding to the serial basis item value in the document business table; storing N serial numbers greater than the current water level value in the M serial numbers into a set; and determining the serial number according to the current water level value, the serial number increment step and the set.
[0008] In one of the embodiments, the serial number is determined according to the current water level value, the serial number increment step and the set, comprising: obtaining a sum result by summing the current water level value and the serial number increment step; judging whether the sum result is in the set; if the sum result is not in the set, taking the sum result as the serial number; and if the sum result is in the set, taking the sum result as the current water level value and repeating the above process until the sum result is not in the set.
[0009] In one of the embodiments, before the serial number is determined according to the current water level value, the serial number increment step and the set, the method further comprises: querying K break numbers smaller than the current water level value in the break numbers corresponding to the coding rule ID and the serial basis item value in the break number table; and updating the current water level value to the minimum value in the K break numbers.
[0010] In one of the embodiments, after the serial number is determined according to the current water level value, the serial number increment step and the set, the method further comprises: updating the water level value corresponding to the coding rule ID and the serial basis item value in the serial number water level table to the serial number, and deleting the break numbers greater than the serial number in the break numbers corresponding to the coding rule ID and the serial basis item value in the break number table.
[0011] In one of the embodiments, the water level value corresponding to the coding rule ID and the serial basis item value in the serial number water level table is updated according to the break number check starting point value, comprising: judging whether the water level value corresponding to the coding rule ID and the serial basis item value in the serial number water level table is greater than the break number check starting point value; if yes, updating the water level value corresponding to the coding rule ID and the serial basis item value in the serial number water level table to the break number check starting point value.
[0012] In one of the embodiments, the obtaining the number recovery request comprises: detecting that a user triggers an operation on a number recovery input in an encoding rule editing interface; determining whether to display a flow basis item editing input according to encoding rule information corresponding to the encoding rule editing interface after the user triggers the operation on the number recovery input in the encoding rule editing interface; displaying a number recovery setting interface including the flow basis item editing input if it is determined to display the flow basis item editing input; receiving a flow basis item value and a number check starting point value input by the user through the number recovery setting interface, and obtaining an encoding rule ID from the encoding rule information; and generating the number recovery request based on the flow basis item value, the number check starting point value, and the encoding rule ID.
[0013] In a second aspect, the present application provides a flow number processing apparatus, comprising:
[0014] The number recovery module is configured to obtain a number recovery request, the number recovery request carrying an encoding rule ID, a flow basis item value, and a number check starting point value; the number recovery module is further configured to update a water level value corresponding to the encoding rule ID and the flow basis item value in a flow number water level table according to the number check starting point value; the flow number obtaining module is configured to obtain a flow number obtaining request, the flow number obtaining request carrying a document type and a flow basis item value; the flow number obtaining module is further configured to obtain an encoding rule ID according to the document type, obtain a current water level value according to the encoding rule ID and the flow basis item value, and determine a flow number according to the document type, the encoding rule ID, the flow basis item value, and the current water level value.
[0015] In a third aspect, the present application further provides a computer device. The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method provided in the first aspect when executing the computer program.
[0016] In a fourth aspect, the present application further provides a computer readable storage medium. The computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method provided in the first aspect.
[0017] In a fifth aspect, the present application further provides a computer program product. The computer program product comprises a computer program, and the computer program is executed by a processor to implement the method provided in the first aspect.
[0018] The serial number processing method, device and computer equipment described above acquire a serial number recovery request, the serial number recovery request carrying an encoding rule ID, a serial number basis item value and a serial number check starting point value; according to the serial number check starting point value, the water level value corresponding to the encoding rule ID and the serial number basis item value in the serial number water level table is updated; a serial number acquisition request is acquired, the serial number acquisition request carrying a document type and a serial number basis item value; according to the document type, the encoding rule ID is acquired, according to the encoding rule ID and the serial number basis item value, the current water level value is acquired, and according to the document type, the encoding rule ID, the serial number basis item value and the current water level value, the serial number is determined. The human cost is reduced, and the efficiency is greatly improved. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 It is a schematic diagram of the database table structure design in an embodiment;
[0020] Figure 2 It is an example diagram of the database table storage data in an embodiment;
[0021] Figure 3 It is a schematic diagram of the system in an embodiment;
[0022] Figure 4 It is a flowchart of the serial number processing method in an embodiment;
[0023] Figure 5 It is a schematic diagram of the serial number recovery input in an embodiment;
[0024] Figure 6 It is a schematic diagram of the serial number recovery setting interface in an embodiment;
[0025] Figure 7 It is a structural block diagram of the serial number processing device in an embodiment;
[0026] Figure 8 It is an internal structure diagram of the computer equipment in an embodiment. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0028] In some embodiments, when a business document is deleted, the business code corresponding to the business document triggers a serial number recovery interface to save the serial number in the document code of the business document into a serial number table or a serial number cache. When a new business document is added next time, the serial number in the serial number table or the serial number cache is preferentially queried for use as the serial number in the new document code. However, since the business code corresponding to the business document may have a vulnerability, when the business document is deleted, the business code may fail to trigger the serial number recovery interface. In addition, due to the system runtime environment, such as sudden power failure of a server or restart of a service process, the serial number recovery interface may fail to work normally. The above two phenomena may both cause the serial number to fail to be normally recovered. In the face of the above problems, for the business document that allows a user to edit and supplement the document code, the user can manually supplement and modify the serial number in the document code, thereby repairing the serial number and ensuring the serial number continuity of the business document. For the business document that does not allow the user to edit and supplement the document code, only the system technical support personnel can manually modify the serial number table in the background, thereby adding the serial number that fails to be normally recovered into the serial number table, so as to ensure the serial number continuity of the business document. No matter which way is used, a large amount of manpower is required, the processing process is complicated, the efficiency is not high, and errors are prone to occur again.
[0029] Therefore, an embodiment of the present application provides a serial number processing method. In a serial number recovery stage, a serial number recovery request is obtained, the serial number recovery request carrying a coding rule ID, a serial basis item value, and a serial number check starting point value. According to the serial number check starting point value, the water level value corresponding to the coding rule ID and the serial basis item value in the serial number water level table is updated. In a serial number acquisition stage, a serial number acquisition request is obtained, the serial number acquisition request carrying a document type and a serial basis item value. According to the document type, a coding rule ID is obtained. According to the coding rule ID and the serial basis item value, a current water level value is obtained. According to the document type, the coding rule ID, the serial basis item value, and the current water level value, a serial number is determined. The continuity and the order of the serial number can be ensured, and the manpower cost is reduced, and the efficiency is greatly improved. Details are shown in the following.
[0030] For the convenience of understanding, the terms related to the embodiments of the present application are described as follows.
[0031] Document serial number: an integer number with a fixed length, a filler, and an increment according to a serial basis item value and a specified increment step, hereinafter referred to as a serial number.
[0032] Document serial number gap: the difference between two adjacent serial numbers with the same serial basis item value in all business documents of a certain document type saved by the system is not equal to the incremental step, then there is a document serial number gap between the two adjacent serial numbers, hereinafter referred to as gap. For example, the system has saved the serial numbers 001, 002 and 005 in the document business table corresponding to the purchase order, and if the incremental step is 1, and the difference between 2 and 5 is not equal to the incremental step 1, then there is a gap (003 and 004) in the middle.
[0033] Serial basis item: a classification record basis for serial numbers under the same document type. The system records the maximum value of the gap and the used serial numbers according to the serial basis item value. The serial basis item can be a date or a code of basic data, for example, a customer code or a supplier code. For example, if the date is the serial basis item, and the maximum value of the used serial number on December 1, 2021 is 6, then the serial number of the document code on December 2, 2021 should be obtained and recorded from serial number 1, not from 7.
[0034] Serial level value: the maximum value of the used serial number under each serial basis item value.
[0035] Document code: a group of strings that identify a document. The document code can be customized by the user, and a document code includes at least one segment, which may contain: fixed string constant, date, code or name of basic data, serial number, etc.
[0036] Coding rule: a generation rule of the document code that can be set by the user, which determines whether a document code contains fixed string constant, date, code or name of basic data, serial number, etc. segment, and determines the order between these segments, the separator between the segments, the length of the serial number, the serial number filler, the incremental step of the serial number, whether there is a serial basis item, etc.
[0037] Gap recycling: the gap caused by deleting business documents or missing business documents, etc. can still be obtained and used in order when the next document is added, and this process is gap recycling.
[0038] Coding rule master table: the background database table structure design is as follows Figure 1As shown, mainly involves 4 tables, respectively: encoding rule main table, encoding rule sub table, serial number water level table and break number table. Among them, the encoding rule main table is used to store the encoding rule ID corresponding to each type of document, the core field of the encoding rule main table includes: encoding rule ID (integer type, primary key), document type (string type, record the corresponding document type), segment number (integer type, record how many segments of the document code), segment separator (string type, record the separator between each segment of the document code).
[0039] Encoding rule sub table: used to store the segment information corresponding to each encoding rule ID, one row of data corresponds to a segment in the document code, and the encoding rule main table is many-to-one relationship; The core fields of the encoding rule sub table include: encoding rule ID (integer type, foreign key, corresponding to the encoding rule ID field in the encoding rule main table), segment sequence number (integer type, recording the position of the segment corresponding to this row of data in the document code), segment type (enumeration type, recording the type of the segment corresponding to this row of data, such as constant, date, basic data or serial number), whether serial number basis item (integer type, 1 indicates that the segment corresponding to this row of data is a serial number basis item, 0 is not), basic data reference object (string type, if the segment corresponding to this row of data The value of the segment type field is "basic data", record which basic data is referenced, otherwise the value is an empty string), constant value (string type, if the segment corresponding to this row of data The value of the segment type field is "constant", it has a value, otherwise the value is an empty string), serial number fill symbol (string type, when the serial number is not the maximum serial number length, use the fill symbol to left fill), serial number increment step (integer type, record the value of the serial number increment each time), serial number initial value (integer type, corresponding to the initial value of the serial number obtained for the first time under the value of the serial number basis item).
[0040] Serial number water level table: used to store the maximum value (i.e. water level value) of the used serial number corresponding to each serial number basis item value under the encoding rule, which is many-to-one relationship with the encoding rule main table, and the core fields of the serial number water level table include: encoding rule ID (integer type, foreign key, corresponding to the encoding rule ID field in the encoding rule main table), serial number basis item (string type, recording the serial number basis item value corresponding to the water level value), water level value (integer type, recording the maximum serial number used under the corresponding serial number basis item value in all business documents).
[0041] Break number table: used to store the break number that has been normally recycled by the break number recycling interface under each serial number basis item value corresponding to the encoding rule, which is many-to-one relationship with the encoding rule main table; The core fields of the break number table include: encoding rule ID (integer type, foreign key, corresponding to the encoding rule ID field in the encoding rule main table), serial number basis item and break number value.
[0042] When a user wants to set the coding rule of a certain type of document code, the user can input the type of the document on the coding rule editing interface provided by the terminal and set the values of each field involved in the above-mentioned rule coding master table and rule coding sub-table. The terminal can send the values set by the user to the server, so that the server can generate the above-mentioned four tables. For example, Figure 2 The schematic diagram of the rule coding master table and the rule coding sub-table of the purchase order generated by the server based on the values set by the user, and the serial number table and the serial number level table generated based on all the purchase orders, the rule coding master table and the rule coding sub-table are shown. From the rule coding master table and the rule coding sub-table, Figure 2 It can be seen from the rule coding master table and the rule coding sub-table that the document code of the purchase order includes three segments, which are constant (the value is "CGDD"), date (serial number basis), serial number (the filler is 0, the incremental step is 1, the length is 3, and the initial value is 1), and the separator between each segment is "-". As shown in Figure 2 The table recording all the purchase orders is called the purchase order master table, and the purchase order master table records the document date, the document code, the serial number basis and the serial number. From the purchase order master table, it can be seen that the maximum value of the serial number used on December 1, 2021 and December 2, 2021 is 6 and 5 respectively, so the serial number level table has two corresponding records; 2021-12-01 generates two serial numbers 3 and 5, and 2021-12-02 generates one serial number 2; only two business codes in the serial number table trigger the serial number recovery interface to recover the serial number normally, which are 5 of 2021-12-01 and 2 of 2021-12-02, which indicates that the serial number 3 of 2021-12-01 is not recovered normally.
[0043] The serial number processing method provided by the embodiment of the application can be applied to the system as shown in Figure 3 The system shown in Figure 3 The system shown in includes a terminal and a server. The terminal can be any device configured with an interactive screen, such as a personal computer, a notebook computer, a smart phone, a tablet computer, an Internet of Things device and a portable wearable device. The Internet of Things device can be a smart speaker, a smart television, a smart air conditioner, a smart vehicle device, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. Figure 3 The personal computer is used in the embodiment. The server can be implemented by an independent server or a server cluster composed of multiple servers, Figure 3 The independent server is used in the embodiment.
[0044] The embodiments of the present application can be applied to an enterprise resource planning (ERP) system to perform serial number processing on business documents in the ERP system, where the ERP system includes, but is not limited to, a production management system, a supply chain system, a personnel system, a financial system, a tax system, and an audit system.
[0045] The implementation process of the serial number processing method will be described in detail below in combination with specific embodiments.
[0046] In one embodiment, a serial number processing method is provided, as shown in Figure 4 The method includes the following steps:
[0047] S402, a serial number recovery request is acquired, and the serial number recovery request carries an encoding rule ID, a serial basis item value, and a serial number check starting point value.
[0048] In some embodiments, the terminal can provide an encoding rule editing interface, which is not only provided with an entry for editing the encoding rule, but also provided with a serial number recovery entry. A user can trigger the serial number recovery process of the embodiments of the present application by triggering the serial number recovery entry. The embodiments of the present application do not limit the implementation manner of various entries involved, for example, the serial number recovery entry can be a serial number recovery control, and the like. It should be noted that, for the case that there are multiple document types in the enterprise resource planning (ERP) system, multiple serial number recovery entries corresponding to the multiple document types can be displayed in the encoding rule editing interface, and a user can trigger according to needs.
[0049] In some embodiments, after the terminal detects the triggering operation of the user on the serial number recovery entry in the encoding rule editing interface, it determines whether to display a serial basis item editing entry according to the encoding rule information corresponding to the encoding rule editing interface; if it is determined to display the serial basis item editing entry, a serial number recovery setting interface including the serial basis item editing entry is displayed.
[0050] Specifically, after detecting the triggering operation of the user on the break number recycling input, the coding rule editing interface transmits the coding rule information corresponding to the coding rule editing interface to the break number recycling setting interface. The coding rule information includes a coding rule ID, flow number segmentation setting information, and, if the user sets a flow basis item, a flow basis item type and a flow basis item format. In this case, the coding rule information further includes the flow basis item type and the flow basis item format. After receiving the coding rule information, the break number recycling setting interface can determine whether to display the flow basis item editing input according to the coding rule information. Specifically, whether to display the flow basis item editing input can be determined according to whether the coding rule information includes the flow basis item type and the flow basis item format. If the coding rule information includes the flow basis item type and the flow basis item format, it is determined that the flow basis item editing input is displayed. If the coding rule information does not include the flow basis item type and the flow basis item format, it is determined that the flow basis item editing input is not displayed. Further, if it is determined that the flow basis item editing input is displayed, the corresponding editing input is added to the break number recycling setting interface according to the coding rule information. Specifically, the input corresponding to the flow basis item type and the flow basis item format can be added to the break number recycling setting interface. For example, if the flow basis item type is date, a date input is added to the break number recycling setting interface. If the flow basis item type is basic information, a basic information selection input is added to the break number recycling setting interface. Finally, the break number recycling setting interface including the flow basis item editing input is displayed.
[0051] Optionally, the break number recycling input can be set in the form shown in FIG. 6. Figure 5
[0052] In some embodiments, the terminal receives the flow basis item value and the break number check starting point value input by the user through the break number recycling setting interface, and obtains the coding rule ID from the coding rule information. Based on the flow basis item value, the break number check starting point value, and the coding rule ID, the terminal generates a break number recycling request.
[0053] Optionally, the user can input the flow basis item value and the break number check starting point value according to actual conditions. If the flow basis item type is date, the flow basis item value, i.e., the date value, is input through the date input. If the flow basis item type is basic information, the flow basis item value, i.e., the specific basic information coding data, such as the user code, is selected through the basic information selection input.
[0054] Optionally, after detecting the triggering operation of the user on the break number recycling input, the terminal can display the break number table stored in the server, so that the user can query, in the break number table, which break numbers are not normally recycled for the input flow basis item value, and the smallest break number among the break numbers is taken out. When the flow basis item value and the break number check starting point value are input, it is ensured that the input break number check starting point value is smaller than the smallest break number among the break numbers that are not normally recycled.
[0055] Optionally, the settings interface for reclaiming lost numbers can be set to... Figure 6 As shown in the figure.
[0056] by Figure 2 For example, on 2021-12-01, a missing number 3 was not properly recovered. Since the serial number reference type is date and the format is yyyy-mm-dd, the serial number reference value is entered as 2021-12-01. The starting point for the missing number check is entered as a value smaller than the missing number 3, such as 1 or 2. In this embodiment, 1 is used as an example for explanation.
[0057] S404. Based on the starting point value of the serial number check, update the encoding rule ID and the corresponding water level value of the serial number water level table.
[0058] Optionally, it can be determined whether the water level value corresponding to the above coding rule ID and the value of the serial number basis item in the serial number water level table is greater than the starting point value of the serial number break check; if it is greater, the water level value corresponding to the above coding rule ID and the value of the serial number basis item in the serial number water level table is updated to the starting point value of the serial number break check, and the current water level value is the starting point value of the serial number break check; if it is less than or equal to, the water level value in the serial number water level table is not updated, and the current water level value is still the original water level value.
[0059] The following example illustrates this:
[0060] Assuming the number churn recovery request carries an encoding rule ID of 1, a serial number reference value of 2021-12-01, and a number churn check start point value of 1, according to... Figure 2 The illustrated serial number water level table shows that when the coding rule ID is 1 and the serial number reference value is 2021-12-01, the corresponding water level value is 6. Since 6 is greater than 1, the water level value corresponding to the coding rule ID 1 and the serial number reference value is 2021-12-01 in the serial number water level table is updated to 1.
[0061] Optionally, after executing the S404, the server can return a processing result status to the terminal, indicating whether the processing was successful or failed. If the processing result status indicates successful processing, a prompt message can be displayed on the interface, after which the user can close the disconnected number recycling settings interface.
[0062] S406. Request to obtain serial number. The request to obtain serial number carries the document type and the value of the serial number reference item.
[0063] In some embodiments, after the terminal detects the user's trigger operation on the entry point for adding a new business document, it sends a serial number retrieval request to the server. The serial number retrieval request carries the document type and the value of the serial number reference item.
[0064] Optionally, when the user wants to add a business document of a certain document type, the user can trigger the add business document entry on the relevant page of the document type. For example, when the user wants to add a purchase order, the user can trigger the add business document entry on the relevant page of the purchase order.
[0065] Optionally, before triggering the add business document entry, the user can input the serial basis item value on the same page. For example, before triggering the add business document entry on the relevant page of the purchase order, the user can also input the serial basis item value on the same page. The serial basis item value here is the same as the serial basis item value input in the serial number recycling setting interface.
[0066] S408, according to the document type, the coding rule ID corresponding to the document type is obtained.
[0067] Optionally, according to the document type, the coding rule ID corresponding to the document type can be queried in the coding rule master table, such as Figure 1 and Figure 2 The coding rule master table is used to indicate the corresponding relationship between the document type and the coding rule ID.
[0068] The following is an example:
[0069] Suppose the document type carried by the serial number acquisition request is a purchase order, and according to the coding rule master table shown in Figure 2 , the coding rule ID corresponding to the purchase order is 1.
[0070] S4010, according to the coding rule ID and the serial basis item value, the current water level value is obtained.
[0071] Optionally, according to the coding rule ID and the serial basis item value, the water level value corresponding to the coding rule ID and the serial basis item value can be queried in the serial number water level table, and the queried water level value is taken as the current water level value.
[0072] The following is an example:
[0073] Suppose the document type carried by the serial number acquisition request is a purchase order, and the serial basis item value is 2021-12-01, according to the coding rule master table shown in Figure 2 , the coding rule ID corresponding to the purchase order is 1. Since the water level value corresponding to the coding rule ID 1 and the serial basis item value 2021-12-01 is updated to 1 in S408, the queried water level value is 1.
[0074] S4012, according to the document type, the coding rule ID, the serial basis item value, and the current water level value, the serial number is determined.
[0075] Optionally, the flow number increment step can be queried according to the coding rule ID and the coding rule subtable; the document business table corresponding to the document type can be obtained according to the document type; M flow numbers corresponding to the flow basis item value in the document business table can be queried; N flow numbers greater than the current water level value in the M flow numbers can be stored in a set; K break numbers smaller than the current water level value in the break number table corresponding to the coding rule ID and the flow basis item value can be queried; and the current water level value can be updated to the minimum value in the K break numbers. Then, the flow number can be determined according to the current water level value, the flow number increment step and the set.
[0076] Optionally, when the flow number is determined according to the current water level value, the flow number increment step and the set, the following method can be used: the sum of the current water level value and the flow number increment step is obtained to obtain a sum result, it is judged whether the sum result is in the set; if the sum result is not in the set, the sum result is taken as the flow number; if the sum result is in the set, the sum result is taken as the current water level value to repeat the above process until the sum result is not in the set.
[0077] The following examples are given:
[0078] Suppose the document type carried by the flow number acquisition request is a purchase order, and the flow basis item value is 2021-12-01. According to the coding rule main table shown in Figure 2 , it can be queried that the coding rule ID corresponding to the purchase order is 1. Suppose the document business table corresponding to the purchase order is the purchase order main table in Figure 2 , the current water level value is 1. Referring to Figure 2 , based on the coding rule ID, the flow number increment step can be queried from the coding rule subtable, and from the purchase order main table, it can be queried that the flow numbers of 2021-12-01 are 1, 2, 4 and 6, among which the flow numbers greater than 1 are 2, 4 and 6, and 2, 4 and 6 are stored in a set set, then the set set is {2, 4, 6}, the break number corresponding to the coding rule ID 1 and the flow basis item value 2021-12-01 in the break number table is 5, since 5 is greater than 1, the current water level value does not need to be updated, that is, the current water level value is still 1, m=m+s is executed, where m is the current water level value and s is the increment step, it is checked whether m exists in the set set, if yes, m=m+s is continuously executed, if not, m at this time is taken as the final flow number and returned to the terminal. Since m=1 and s=1, m=m+s is executed for the first time to obtain m=2, since 2 belongs to the set set, m=m+s is continuously executed to obtain m=3, since 3 does not belong to the set set, 3 is taken as the final flow number and returned to the terminal.
[0079] Optionally, after determining the final serial number, the water level value corresponding to the code rule ID and the serial basis item value in the serial number water level table is updated to the serial number determined in S408, and the break number greater than the serial number determined in S408 in the break number corresponding to the code rule ID and the serial basis item value in the break number table is deleted.
[0080] The following is an example:
[0081] After determining that 3 is the final serial number, the water level value corresponding to the code rule ID 1 and the serial basis item value 2021-12-01 in the serial number water level table is updated to 3, and the record corresponding to the code rule ID 1 and the serial basis item value 2021-12-01 in the break number table is deleted. That is, the record of the code rule ID 1, the serial basis item value 2021-12-01, and the break number value 5 is deleted.
[0082] In some embodiments, the server sends the serial number determined in S4016 to the terminal. It should be noted that the serial number determined here is also the serial number allocated by the server for the single bill corresponding to the serial number acquisition request.
[0083] The serial number processing method provided by the embodiments of the present application provides a setting interface in the terminal, and the user can input the serial basis item value and the break number check starting point in the setting interface. After the user finishes inputting, the user clicks the confirm button, and the automatic recycling of the break number is realized. In the next addition of the business single bill, the serial number is determined based on the water level value updated in the recycling process, which ensures the continuity of the serial number in the single bill code, reduces the labor cost, and greatly improves the efficiency. In addition, the scheme of the embodiments of the present application recycles the break number by the user setting and triggering the break number recycling through a break number recycling setting interface, which is simple and convenient to operate, and does not need a technical support personnel to manually write code in the system background to modify the database or cache, which greatly reduces the labor and time cost. In the break number recycling stage, all the break numbers are not directly traversed and checked, and the break numbers do not need to be saved to the break number table, but only need to reset the serial number water level value to a smaller value. The whole process only performs a database update operation at most, and the recycling speed is greatly improved. Moreover, the scheme of the embodiments of the present application also supports the user to independently determine the range of the break number check.
[0084] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0085] Based on the same inventive concept, this application also provides a terminal for implementing the above-described serial number processing method. The solution provided by this terminal is similar to the steps on the terminal side in the above-described method. Therefore, the specific limitations in one or more terminal embodiments provided below can be found in the steps on the terminal side above, and will not be repeated here.
[0086] Based on the same inventive concept, this application also provides a server for implementing the above-described serial number processing method. The solution provided by this server is similar to the steps on the server side in the above-described method. Therefore, the specific limitations of one or more server embodiments provided below can be found in the steps on the server side above, and will not be repeated here.
[0087] In one embodiment, such as Figure 7 As shown, a serial number processing device is provided, comprising:
[0088] The serial number closure module 701 is used to obtain a serial number closure request, which carries the coding rule ID, the serial number basis value, and the serial number closure check start point value. The serial number closure module 701 is also used to update the water level value corresponding to the coding rule ID and the serial number basis value in the serial number water level table according to the serial number closure check start point value. The serial number acquisition module 702 is used to obtain a serial number acquisition request, which carries the document type and the serial number basis value. The serial number acquisition module 702 is also used to obtain the coding rule ID according to the document type, obtain the current water level value according to the coding rule ID and the serial number basis value, and determine the serial number according to the document type, the coding rule ID, the serial number basis value, and the current water level value.
[0089] In some embodiments, the serial number obtaining module 702 is specifically configured to: query the serial number increment step according to the coding rule ID and the coding rule subtable; obtain a document business table corresponding to the document type according to the document type; query M serial numbers corresponding to the serial basis item value in the document business table; store N serial numbers greater than the current water level value in the M serial numbers in a set; and determine the serial number according to the current water level value, the serial number increment step, and the set.
[0090] In some embodiments, the serial number obtaining module 702 is specifically configured to: obtain a sum result by summing the current water level value and the serial number increment step, and determine whether the sum result is in the set; if the sum result is not in the set, take the sum result as the serial number; and if the sum result is in the set, take the sum result as the current water level value and repeat the above process until the sum result is not in the set.
[0091] In some embodiments, the serial number obtaining module 702 is further configured to: query K break numbers smaller than the current water level value in the break number corresponding to the coding rule ID and the serial basis item value in the break number table; and update the current water level value to the minimum value in the K break numbers.
[0092] In some embodiments, the serial number obtaining module 702 is further configured to: update the water level value corresponding to the coding rule ID and the serial basis item value in the serial number water level table to the serial number, and delete the break number greater than the serial number in the break number corresponding to the coding rule ID and the serial basis item value in the break number table.
[0093] In some embodiments, the break number recycling module 701 is specifically configured to: determine whether the water level value corresponding to the coding rule ID and the serial basis item value in the serial number water level table is greater than the break number check starting point value; if it is greater, update the water level value corresponding to the coding rule ID and the serial basis item value in the serial number water level table to the break number check starting point value.
[0094] In some embodiments, the break number recycling module 701 is specifically configured to: after detecting a trigger operation of the break number recycling input on the coding rule editing interface by a user, determine whether to display a serial basis item editing input according to the coding rule information corresponding to the coding rule editing interface; if it is determined to display the serial basis item editing input, display a break number recycling setting interface including the serial basis item editing input; receive the serial basis item value and the break number check starting point value input by the user through the break number recycling setting interface, and obtain the coding rule ID from the coding rule information; and generate a break number recycling request based on the serial basis item value, the break number check starting point value, and the coding rule ID.
[0095] Each of the above terminal and server can be realized by software, hardware and combination thereof in whole or in part. The above modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to each of the above modules.
[0096] In one embodiment, a computer device, which can be a server, has an internal structure diagram as shown in Figure 8 The computer device includes a processor, a memory and a network interface connected by a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The database of the computer device is configured to store data required to be stored by the server side in the above serial number processing method. The network interface of the computer device is configured to communicate with the terminal outside through the network connection. The computer program is executed by the processor to implement a serial number processing method.
[0097] Those skilled in the art can understand that Figure 8 The structure shown in the above embodiment is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0098] In one embodiment, a computer device includes a memory and a processor. The memory stores a computer program. The processor executes the computer program to implement the following steps:
[0099] A serial number recovery request is obtained, the serial number recovery request carrying an encoding rule ID, a serial basis item value and a serial check starting point value. According to the serial check starting point value, the water level value corresponding to the encoding rule ID and the serial basis item value in the serial number water level table is updated. A serial number obtaining request is obtained, the serial number obtaining request carrying a document type and a serial basis item value. According to the document type, the encoding rule ID is obtained. According to the encoding rule ID and the serial basis item value, the current water level value is obtained. According to the document type, the encoding rule ID, the serial basis item value and the current water level value, the serial number is determined.
[0100] In some embodiments, the processor, when executing the computer program, also implements the following steps: querying the serial number incremental step according to the coding rule ID and the coding rule subtable; obtaining a document business table corresponding to the document type according to the document type; querying M serial numbers corresponding to the serial basis item value in the document business table; storing N serial numbers greater than the current water level value in the M serial numbers into a set; and determining the serial number according to the current water level value, the serial number incremental step, and the set.
[0101] In some embodiments, the processor, when executing the computer program, also implements the following steps: obtaining a sum result by summing the current water level value and the serial number incremental step, and judging whether the sum result is in the set; if the sum result is not in the set, taking the sum result as the serial number; and if the sum result is in the set, taking the sum result as the current water level value and repeating the above process until the sum result is not in the set.
[0102] In some embodiments, the processor, when executing the computer program, also implements the following steps: querying K break numbers smaller than the current water level value in the break number corresponding to the coding rule ID and the serial basis item value in the break number table; and updating the current water level value to the minimum value in the K break numbers.
[0103] In some embodiments, the processor, when executing the computer program, also implements the following steps: updating the water level value corresponding to the coding rule ID and the serial basis item value in the serial number water level table to the serial number, and deleting the break number greater than the serial number in the break number corresponding to the coding rule ID and the serial basis item value in the break number table.
[0104] In some embodiments, the processor, when executing the computer program, also implements the following steps: judging whether the water level value corresponding to the coding rule ID and the serial basis item value in the serial number water level table is greater than the break number check starting point value; if so, updating the water level value corresponding to the coding rule ID and the serial basis item value in the serial number water level table to the break number check starting point value.
[0105] In some embodiments, the processor, when executing the computer program, also implements the following steps: after detecting that the user triggers the break number recycling input in the coding rule editing interface, determining whether to display the serial basis item editing input according to the coding rule information corresponding to the coding rule editing interface; if so, displaying a break number recycling setting interface including the serial basis item editing input; receiving the serial basis item value and the break number check starting point value input by the user through the break number recycling setting interface, and obtaining the coding rule ID from the coding rule information; and generating a break number recycling request based on the serial basis item value, the break number check starting point value, and the coding rule ID.
[0106] In one embodiment, a computer readable storage medium is provided, and a computer program is stored on the computer readable storage medium, and the computer program is executed by a processor to implement the following steps: obtaining a serial number recovery request, the serial number recovery request carrying an encoding rule ID, a serial number basis item value, and a serial number check starting point value; updating a water level value corresponding to the encoding rule ID and the serial number basis item value in a serial number water level table according to the serial number check starting point value; obtaining a serial number acquisition request, the serial number acquisition request carrying a document type and the serial number basis item value; obtaining the encoding rule ID according to the document type, obtaining a current water level value according to the encoding rule ID and the serial number basis item value, and determining a serial number according to the document type, the encoding rule ID, the serial number basis item value, and the current water level value.
[0107] In some embodiments, the computer program is executed by the processor to further implement the following steps: querying a serial number incremental step according to the encoding rule ID and an encoding rule sub-table; obtaining a document business table corresponding to the document type according to the document type; querying M serial numbers corresponding to the serial number basis item value in the document business table; storing N serial numbers greater than the current water level value in the M serial numbers into a set; determining the serial number according to the current water level value, the serial number incremental step, and the set.
[0108] In some embodiments, the computer program is executed by the processor to further implement the following steps: obtaining a sum result by summing the current water level value and the serial number incremental step, judging whether the sum result is in the set; if the sum result is not in the set, taking the sum result as the serial number; if the sum result is in the set, taking the sum result as the current water level value and repeating the above process until the sum result is not in the set.
[0109] In some embodiments, the computer program is executed by the processor to further implement the following steps: querying K serial numbers smaller than the current water level value in the serial numbers corresponding to the encoding rule ID and the serial number basis item value in the serial number table; updating the current water level value to the minimum value in the K serial numbers.
[0110] In some embodiments, the computer program is executed by the processor to further implement the following steps: updating the water level value corresponding to the encoding rule ID and the serial number basis item value in the serial number water level table to the serial number, and deleting serial numbers greater than the serial number in the serial numbers corresponding to the encoding rule ID and the serial number basis item value in the serial number table.
[0111] In some embodiments, the computer program is executed by the processor to further implement the following steps: judging whether the water level value corresponding to the encoding rule ID and the serial number basis item value in the serial number water level table is greater than the serial number check starting point value; if yes, updating the water level value corresponding to the encoding rule ID and the serial number basis item value in the serial number water level table to the serial number check starting point value.
[0112] In some embodiments, the computer program, when executed by the processor, further implements the following steps: detecting that the user triggers the operation of the break number recycling input after the encoding rule editing interface, determining whether to display the serial basis item editing input according to the encoding rule information corresponding to the encoding rule editing interface; if it is determined to display the serial basis item editing input, displaying the break number recycling setting interface including the serial basis item editing input; receiving the serial basis item value and the break number check starting point value input by the user through the break number recycling setting interface, and obtaining the encoding rule ID from the encoding rule information; generating the break number recycling request based on the serial basis item value, the break number check starting point value, and the encoding rule ID.
[0113] In one embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the following steps: obtaining a break number recycling request, the break number recycling request carrying an encoding rule ID, a serial basis item value, and a break number check starting point value; updating the water level value corresponding to the encoding rule ID and the serial basis item value in the serial number water level table according to the break number check starting point value; obtaining a serial number obtaining request, the serial number obtaining request carrying a document type and a serial basis item value; obtaining an encoding rule ID according to the document type, obtaining a current water level value according to the encoding rule ID and the serial basis item value, and determining a serial number according to the document type, the encoding rule ID, the serial basis item value, and the current water level value.
[0114] In some embodiments, the computer program, when executed by the processor, further implements the following steps: querying a serial number incremental step according to the encoding rule ID and the encoding rule sub-table; obtaining a document business table corresponding to the document type according to the document type; querying M serial numbers corresponding to the serial basis item value in the document business table; storing N serial numbers greater than the current water level value in the M serial numbers into a set; determining the serial number according to the current water level value, the serial number incremental step, and the set.
[0115] In some embodiments, the computer program, when executed by the processor, further implements the following steps: summing the current water level value and the serial number incremental step to obtain a sum result, and determining whether the sum result is in the set; if the sum result is not in the set, taking the sum result as the serial number; if the sum result is in the set, taking the sum result as the current water level value and repeating the above process until the sum result is not in the set.
[0116] In some embodiments, the computer program, when executed by the processor, further implements the following steps: querying K break numbers smaller than the current water level value in the break number table corresponding to the encoding rule ID and the serial basis item value; updating the current water level value to the minimum value in the K break numbers.
[0117] In some embodiments, the computer program, when executed by the processor, further implements the following steps: updating the water level value corresponding to the encoding rule ID and the flow basis item value in the flow number water level table to the flow number, and deleting the break number in the break number table corresponding to the encoding rule ID and the flow basis item value that is greater than the flow number.
[0118] In some embodiments, the computer program, when executed by the processor, further implements the following steps: determining whether the water level value corresponding to the encoding rule ID and the flow basis item value in the flow number water level table is greater than the break number check starting point value; if so, updating the water level value corresponding to the encoding rule ID and the flow basis item value in the flow number water level table to the break number check starting point value.
[0119] In some embodiments, the computer program, when executed by the processor, further implements the following steps: after detecting that the user triggers the break number recovery input in the encoding rule editing interface, determining whether to display the flow basis item editing input according to the encoding rule information corresponding to the encoding rule editing interface; if it is determined to display the flow basis item editing input, displaying the break number recovery setting interface including the flow basis item editing input; receiving the flow basis item value and the break number check starting point value input by the user through the break number recovery setting interface, and obtaining the encoding rule ID from the encoding rule information; and generating a break number recovery request based on the flow basis item value, the break number check starting point value, and the encoding rule ID.
[0120] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. The non-volatile memory can include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric memory (Ferroelectric Random Access Memory, FRAM), phase change memory (Phase Change Memory, PCM), graphene memory, etc. The volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0121] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.
[0122] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A method of processing a water number, characterized by, The method comprises: acquiring a broken number recovery request, the broken number recovery request carrying an encoding rule ID, a flow basis item value and a broken number check starting point value; updating a water level value corresponding to the encoding rule ID and the flow basis item value in a flow number water level table according to the broken number check starting point value; acquiring a flow number acquisition request, the flow number acquisition request carrying a document type and the flow basis item value; acquiring the encoding rule ID according to the document type, acquiring a current water level value according to the encoding rule ID and the flow basis item value, and determining a flow number according to the document type, the encoding rule ID, the flow basis item value and the current water level value; the determining of the flow number according to the document type, the encoding rule ID, the flow basis item value and the current water level value comprises: querying a flow number incremental step according to the encoding rule ID and an encoding rule subtable; acquiring a document business table corresponding to the document type according to the document type; querying M flow numbers corresponding to the flow basis item value in the document business table; storing N flow numbers greater than the current water level value in the M flow numbers into a set; determining the flow number according to the current water level value, the flow number incremental step and the set.
2. The method of claim 1, wherein, the determining of the flow number according to the current water level value, the flow number incremental step and the set comprises: obtaining a sum result by summing the current water level value and the flow number incremental step, and judging whether the sum result is in the set; if the sum result is not in the set, taking the sum result as the flow number; if the sum result is in the set, taking the sum result as the current water level value and repeating the above process until the sum result is not in the set.
3. The method according to claim 1 or 2, characterized in that, before the determining of the flow number according to the current water level value, the flow number incremental step and the set, the method further comprises: querying K broken numbers smaller than the current water level value in a broken number corresponding to the encoding rule ID and the flow basis item value in a broken number table; updating the current water level value to the minimum value in the K broken numbers.
4. The method according to claim 1 or 2, characterized in that, after the determining of the flow number according to the current water level value, the flow number incremental step and the set, the method further comprises: updating the water level value corresponding to the encoding rule ID and the flow basis item value in the flow number water level table to the flow number, and deleting the broken number greater than the flow number in the broken number corresponding to the encoding rule ID and the flow basis item value in the broken number table.
5. The method of claim 1, wherein, the updating of the water level value corresponding to the encoding rule ID and the flow basis item value in the flow number water level table according to the broken number check starting point value comprises: judging whether the water level value corresponding to the encoding rule ID and the flow basis item value in the flow number water level table is greater than the broken number check starting point value; if yes, updating the water level value corresponding to the encoding rule ID and the flow basis item value in the flow number water level table to the broken number check starting point value.
6. The method of claim 1, wherein, The acquisition of the break number recycling request comprises: After detecting that the user triggers the break number recycling interface in the coding rule editing interface, determining whether to display the flow basis item editing interface according to the coding rule information corresponding to the coding rule editing interface; If it is determined to display the flow basis item editing interface, a break number recycling setting interface including the flow basis item editing interface is displayed; Receiving the flow basis item value and the break number check starting point value input by the user through the break number recycling setting interface, and acquiring the coding rule ID from the coding rule information; Based on the flow basis item value, the break number check starting point value and the coding rule ID, the break number recycling request is generated.
7. A flow number processing apparatus characterized by comprising: Comprise: The break number recycling module is used for acquiring a break number recycling request, and the break number recycling request carries a coding rule ID, a flow basis item value and a break number check starting point value; The break number recycling module is also used for updating the water level value corresponding to the coding rule ID and the flow basis item value in the flow number water level table according to the break number check starting point value, to obtain a current water level value; The flow number acquisition module is used for acquiring a flow number acquisition request, and the flow number acquisition request carries a document type and the flow basis item value; The flow number acquisition module is also used for acquiring the coding rule ID according to the document type, acquiring a current water level value according to the coding rule ID and the flow basis item value, and determining a flow number according to the document type, the coding rule ID, the flow basis item value and the current water level value; The flow number acquisition module is specifically used for: According to the coding rule ID and a coding rule subtable, a flow number incremental step is queried; According to the document type, a document business table corresponding to the document type is acquired; M flow numbers corresponding to the flow basis item value are queried in the document business table; N flow numbers greater than the current water level value in the M flow numbers are stored in a set; According to the current water level value, the flow number incremental step and the set, the flow number is determined.
8. The apparatus of claim 7, wherein, The flow number acquisition module is specifically used for: The sum of the current water level value and the flow number incremental step is obtained to obtain a sum result, and it is judged whether the sum result is in the set; If the sum result is not in the set, the sum result is taken as the flow number; If the sum result is in the set, the sum result is taken as the current water level value to repeat the above process until the sum result is not in the set. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-8 when the computer program is executed by the processor. The processor executes the computer program to realize the steps of the method in any one of claims 1 to 6.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the steps of the method in any one of claims 1 to 6.
Citation Information
Patent Citations
Service code generation method and system
CN113935285A