CN111950232B - Method and device for automatically switching number segments - Google Patents

Method and device for automatically switching number segments Download PDF

Info

Publication number
CN111950232B
CN111950232B CN201910406057.4A CN201910406057A CN111950232B CN 111950232 B CN111950232 B CN 111950232B CN 201910406057 A CN201910406057 A CN 201910406057A CN 111950232 B CN111950232 B CN 111950232B
Authority
CN
China
Prior art keywords
rule
segment
number segment
early warning
segment rule
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910406057.4A
Other languages
Chinese (zh)
Other versions
CN111950232A (en
Inventor
郝建伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingbangda Trade Co Ltd
Beijing Jingdong Zhenshi Information Technology Co Ltd
Original Assignee
Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Zhenshi Information Technology Co Ltd filed Critical Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority to CN201910406057.4A priority Critical patent/CN111950232B/en
Publication of CN111950232A publication Critical patent/CN111950232A/en
Application granted granted Critical
Publication of CN111950232B publication Critical patent/CN111950232B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/08Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
    • G06Q10/083Shipping
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a method and a device for automatically switching number segments, and relates to the technical field of computers. One embodiment of the method comprises the following steps: generating a current number according to a first number segment rule, recording a log of the current number, updating a record of a maximum number, and storing the maximum number into a cache; if the maximum number acquired from the cache exceeds the early warning threshold value of the first number segment rule, determining a second number segment rule according to the number segment configuration information in the number segment configuration rule; and if the maximum number acquired from the cache is the last number generated according to the first number segment rule, taking the second number segment rule as a new first number segment rule. The embodiment solves the technical problems that the utilization rate of the old number section is insufficient and the new and old number section is not timely or even fails in the process of manually switching the number section or changing the rule through the configuration mode, and achieves the technical effect of smooth and non-perception switching.

Description

Method and device for automatically switching number segments
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for automatically switching number segments.
Background
In the process of generating the express bill numbers, the express bill numbers of the carrier are generated according to the rules given by the carrier, at present, part of carriers are used for giving the single numbers with a certain range value according to a certain specific rule at one time, and if the batch of single numbers are about to run out, the carrier needs to be found in advance to negotiate to allocate new number segments or rules. At present, the method is mainly realized by manually modifying the configuration file and then putting the configuration file on line again, and the switching is completed after the completion of the putting the configuration file on line, namely, the updating switching operation of the new and old sections is realized by manually or dynamically removing the adjustment rule.
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
1. in the process of manually switching the number segments or changing the rules through the configuration mode, the problem that the switching change points of the new number segments and the old number segments are inaccurate can exist, and the utilization rate of the old number segments is insufficient or the switching is not timely.
2. Human errors in the manual operation changing process can cause repetition and failure of new and old segments.
3. At present, the number segment rule generated by a carrier cannot accurately and timely find the problem of the number segment.
Disclosure of Invention
In view of the above, the embodiments of the present invention provide a method and an apparatus for automatically switching number segments, which can solve the problems of insufficient utilization rate of old number segments and untimely or even failure in switching new and old number segments in the process of manually switching number segments or changing rules in a configuration manner.
To achieve the above object, according to one aspect of the embodiments of the present invention, there is provided a method for automatically switching a number segment, including: generating a current number according to a first number segment rule, recording a log of the current number, updating a record of a maximum number, and storing the maximum number into a cache; if the maximum number obtained from the cache exceeds the early warning threshold value of the first number segment rule and the previous number of the current number does not exceed the early warning threshold value, determining a second number segment rule according to the number segment configuration information in the number segment configuration rule; and if the maximum number acquired from the cache is the last number generated according to the first number segment rule, taking the second number segment rule as a new first number segment rule.
Optionally, the determining the second number segment rule according to the number segment configuration information in the number segment configuration rule includes: determining a preparation number segment rule according to the number segment configuration information in the number segment configuration rule; judging whether the preparation number segment rule meets the verification requirement, and if so, taking the preparation number segment rule as a second number segment rule.
Optionally, the determining the preliminary number segment rule according to the number segment configuration information in the number segment configuration rule includes: obtaining number segment configuration information in a number segment configuration rule, wherein the number segment configuration information comprises: number segment prefix, number segment range, early warning threshold value and reminding mode; and determining a preparation number segment rule according to the number segment prefix, the number segment range, the early warning threshold value and the reminding mode.
Optionally, the verification requirement includes: the prepared number generated according to the prepared number segment rule is different from the historical number; the prefix of the prepared number is consistent with the prefix of the number segment in the prepared number segment rule; the prepared number is in the range of the number segment of the prepared number segment rule.
Optionally, after the generating the current number according to the first number segment rule, the method further includes: if the current number exceeds the early warning threshold value of the first number segment rule, an early warning log of the first number segment rule is generated; if the early warning log of the first segment rule is generated, judging whether the second segment rule is determined, if not, alarming in a reminding mode in the first segment rule, and configuring the second segment rule in a manual mode.
According to another aspect of the embodiment of the present invention, there is provided an apparatus for automatically switching a number segment, including: the number generation module is used for: generating a current number according to a first number segment rule, recording a log of the current number, updating a record of a maximum number, and storing the maximum number into a cache; a processing module for: if the maximum number acquired from the cache exceeds the early warning threshold value of the first number segment rule, determining a second number segment rule according to the number segment configuration information in the number segment configuration rule; a switching module, configured to: and if the maximum number acquired from the cache is the last number generated according to the first number segment rule, taking the second number segment rule as a new first number segment rule.
Optionally, the processing module is further configured to: determining a preparation number segment rule according to the number segment configuration information in the number segment configuration rule; judging whether the preparation number segment rule meets the verification requirement, and if so, taking the preparation number segment rule as a second number segment rule.
Optionally, the processing module is further configured to: obtaining number segment configuration information in a number segment configuration rule, wherein the number segment configuration information comprises: number segment prefix, number segment range, early warning threshold value and reminding mode; and determining a preparation number segment rule according to the number segment prefix, the number segment range, the early warning threshold value and the reminding mode.
Optionally, the processing module is further configured to determine the verification requirement: the prepared number generated according to the prepared number segment rule is different from the historical number; the prefix of the prepared number is consistent with the prefix of the number segment in the prepared number segment rule; the prepared number is in the range of the number segment of the prepared number segment rule.
Optionally, the processing module is further configured to: if the current number exceeds the early warning threshold value of the first number segment rule, an early warning log of the first number segment rule is generated; if the early warning log of the first segment rule is generated, judging whether the second segment rule is determined, if not, alarming in a reminding mode in the first segment rule, and configuring the second segment rule in a manual mode.
According to still another aspect of an embodiment of the present invention, there is provided an electronic apparatus including: one or more processors; and the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are enabled to realize the method for automatically switching the number segments according to the embodiment of the invention.
According to a further aspect of an embodiment of the present invention, there is provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements a method for automatically switching number segments as proposed by an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: because the use condition of the number segments is dynamically monitored in real time by setting the early warning threshold value so as to determine the new number segment rule in advance, the technical problems that the utilization rate of the old number segments is insufficient and the new number segments are not timely or even fail in the process of manually switching the number segments or changing the rule by a configuration mode are solved, the old number segments are smoothly switched to the new number segments according to the new number segment rule after the original number segments are exhausted, the waste of the old number segments is avoided, and meanwhile, the technical effect of smooth and non-perception switching is achieved.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the basic flow of a method of automatically switching number segments according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a preferred flow of a method of automatically switching number segments according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of segment rule core information according to an embodiment of the present invention;
FIG. 4 is a segment rule validation test flow chart according to an embodiment of the invention;
FIG. 5 is a schematic diagram of segment usage monitoring and early warning according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of segment switch monitoring in accordance with an embodiment of the invention;
FIG. 7 is a schematic diagram of the basic modules of an apparatus for automatically switching number segments according to an embodiment of the present invention;
FIG. 8 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
fig. 9 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a basic flow of a method of automatically switching number segments according to an embodiment of the present invention. As shown in fig. 1, an embodiment of the present invention provides a method for automatically switching a number segment, including:
s101, generating a current number according to a first number segment rule, recording a log of the current number, updating a record of a maximum number, and storing the maximum number into a cache;
step S102, if the maximum number obtained from the cache exceeds an early warning threshold value of the first number segment rule, determining a second number segment rule according to the number segment configuration information in the number segment configuration rule;
and S103, if the maximum number obtained from the cache is the last number generated according to the first number segment rule, taking the second number segment rule as a new first number segment rule to finish the switching of the number segments.
The technical means of dynamically monitoring the use condition of the number segments in real time by setting the early warning threshold value to determine the new number segment rule in advance is adopted, so that the technical problems that the utilization rate of the old number segments is insufficient and the new number segments are not timely or even fail in the process of manually switching the number segments or changing the rule by a configuration mode are solved, the old number segments are directly and smoothly switched to the new number segments according to the new number segment rule after the original number segments are exhausted, the waste of the old number segments is avoided, and the technical effect of smooth and non-perception switching is achieved.
In the embodiment of the present invention, the determining the second number segment rule according to the number segment configuration information in the number segment configuration rule includes: determining a preparation number segment rule according to the number segment configuration information in the number segment configuration rule; judging whether the preparation number segment rule meets the verification requirement, and if so, taking the preparation number segment rule as a second number segment rule. The verification of the rule of the preparation number segment can accurately and timely find out the problems of the rule of the preparation number segment, thereby ensuring the correctness of the newly generated number after switching and avoiding faults.
In the embodiment of the present invention, the determining the preliminary number segment rule according to the number segment configuration information in the number segment configuration rule includes: obtaining number segment configuration information in a number segment configuration rule, wherein the number segment configuration information comprises: number segment prefix, number segment range, early warning threshold value and reminding mode; and determining a preparation number segment rule according to the number segment prefix, the number segment range, the early warning threshold value and the reminding mode.
In an embodiment of the present invention, the verification requirement includes: the prepared number generated according to the prepared number segment rule is different from the historical number; the prefix of the prepared number is consistent with the prefix of the number segment in the prepared number segment rule; the prepared number is in the range of the number segment of the prepared number segment rule. The method has the advantages that the uniqueness and the correctness of the prepared number segment rule are verified, and the problems of the prepared number segment rule can be accurately and timely found, so that the reliability and the correctness of the new number segment rule after switching are ensured, smooth switching is realized, and faults are avoided.
In the embodiment of the present invention, after the current number is generated according to the first number segment rule, the method further includes: if the current number exceeds the early warning threshold value of the first number segment rule, an early warning log of the first number segment rule is generated; if the early warning log of the first segment rule is generated, judging whether the second segment rule is determined, if not, alarming in a reminding mode in the first segment rule, and configuring the second segment rule in a manual mode. In the automatic switching process, a switching fault is found in time, and the fault is solved in a manual configuration mode.
FIG. 2 is a schematic diagram of a preferred flow of a method of automatically switching number segments according to an embodiment of the present invention; as shown in fig. 2, after carrier number information is obtained, the number is matched with a number generation rule (a generation rule of a current number, namely, a first number segment rule) and whether an early warning threshold is exceeded or not is verified, if yes, reminding such as a short message or a mail is carried out, information such as a new number segment rule needs to be input to the carrier and the number segment rule of early warning, and the uniqueness and the correctness of the information of the new number segment rule (a preparation number segment rule) are verified during input. After each time the carrier express number information is acquired, whether the number is the last number needs to be judged, if the number is the last number, the method is automatically switched to a new number segment rule which is verified to generate a new number.
The setting of the number segment rule is to perform unified management on the number segments of all carriers, and when the original number segment is fast to the end of use, the number segment rule is automatically switched to a new corresponding number segment rule. FIG. 3 is a diagram of segment configuration rule core information according to an embodiment of the present invention; as shown in fig. 3, the number segment configuration rule core information mainly includes information such as a bracket segment prefix, a number segment range, an early warning threshold value, a reminding mode and the like. And generating and determining data such as types and ranges covered by the bill through the number segment prefix and the number segment range, and carrying out early warning after the generated number reaches or remains a certain configuration early warning threshold value and reminding in a mail, short message and other modes.
When a new rule or a modification rule needs to be set, firstly, assembling numbers are simulated according to the related rule through new rule configuration data, then, correctness and uniqueness verification are carried out on the numbers, whether the main verification number generation rule is matched with the document actually generated belongs to the corresponding carrier and the number segment range or not is verified, and the uniqueness verification mainly verifies that the numbers generated by different carriers according to the rule are required to be ensured to exist uniquely in the whole system. FIG. 4 is a segment rule validation test flow chart according to an embodiment of the invention; as shown in fig. 4, if the correct and unique verification is passed, a verification passing log is recorded and a verification passing state is updated, and if the verification is failed, a verification failing reason is recorded and a verification failure state is updated. When verification fails, a corresponding prompt is made, so that an operator can find out the problem in time to make corresponding adjustment for resetting.
FIG. 5 is a schematic diagram of segment usage monitoring and early warning according to an embodiment of the present invention; as shown in fig. 5, after the newly generated number information is acquired, the number and the corresponding rule of the number need to be compared, if the range comparison is performed, the difference comparison is analyzed, whether the number reaches the early warning threshold value is judged according to the rule, and if the number reaches the threshold value, early warning reminding needs to be performed. After the reminding is generated, a number early warning log is required to be recorded, an alarm reminding log is required to be recorded, if the number early warning log is required to be recorded, the number section value is required to be close to the range section to be switched, at the moment, whether preset automatic switching new number section rule data exist or not is required to be inquired and confirmed, if the number section rule data exist, the number section rule data are not processed temporarily, and after the number section is used up, the number section rule is directly switched, if the number section rule data do not exist, a short message or mail reminding is required to be carried out, and the new number section rule of a carrier is required to be manually maintained and increased.
FIG. 6 is a schematic diagram of segment switch monitoring in accordance with an embodiment of the invention; as shown in fig. 6, after the current latest number is obtained according to the current number rule, whether the number is the last number segment of the rule needs to be judged, if the last number segment is not reached, the current number is returned, and if the last number segment is reached, a new number segment value needs to be generated by obtaining a new number segment rule and the new number segment value is used. The newly generated number is generated by adopting the latest rule, at the moment, the rule data needs to be changed, the latest rule data is updated into the existing rule, and the switching and change logs are recorded, so that the switching time and the switching rule content are convenient to trace.
Fig. 7 is a schematic diagram of basic modules of an apparatus for automatically switching number segments according to an embodiment of the present invention. As shown in fig. 7, an embodiment of the present invention provides an apparatus 700 for automatically switching a number segment, including: a number generation module 701, configured to: generating a current number according to a first number segment rule, recording a log of the current number and storing the log of the current number into a database; a processing module 702, configured to: if the current number exceeds the early warning threshold value of the first number segment rule, determining a second number segment rule according to the number segment configuration information in the number segment configuration rule; a switching module 703, configured to: and if the current number is the last number generated according to the first number segment rule, taking the second number segment rule as a new first number segment rule to finish the switching of the number segments.
In the embodiment of the present invention, the processing module 702 is further configured to: determining a preparation number segment rule according to the number segment configuration information in the number segment configuration rule; judging whether the preparation number segment rule meets the verification requirement, and if so, taking the preparation number segment rule as a second number segment rule.
In the embodiment of the present invention, the processing module 702 is further configured to: obtaining number segment configuration information in a number segment configuration rule, wherein the number segment configuration information comprises: number segment prefix, number segment range, early warning threshold value and reminding mode; and determining a preparation number segment rule according to the number segment prefix, the number segment range, the early warning threshold value and the reminding mode.
In the embodiment of the present invention, the processing module 702 is further configured to determine the verification requirement: the prepared number generated according to the prepared number segment rule is different from the historical number; the prefix of the prepared number is consistent with the prefix of the number segment in the prepared number segment rule; the prepared number is in the range of the number segment of the prepared number segment rule.
In the embodiment of the present invention, the processing module 702 is further configured to: if the current number exceeds the early warning threshold value of the first number segment rule, an early warning log of the first number segment rule is generated; if the early warning log of the first segment rule is generated, judging whether the second segment rule is determined, if not, alarming in a reminding mode in the first segment rule, and configuring the second segment rule in a manual mode.
Fig. 8 illustrates an exemplary system architecture 800 of a method or apparatus for automatically switching segments in which embodiments of the present invention may be applied.
As shown in fig. 8, a system architecture 800 may include terminal devices 801, 802, 803, a network 804, and a server 805. The network 804 serves as a medium for providing communication links between the terminal devices 801, 802, 803 and the server 805. The network 804 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 805 through the network 804 using the terminal devices 801, 802, 803 to receive or send messages or the like. Various communication client applications, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc., may be installed on the terminal devices 801, 802, 803.
The terminal devices 801, 802, 803 may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 805 may be a server providing various services, such as a background management server providing support for shopping-type websites browsed by the user using the terminal devices 801, 802, 803. The background management server can analyze and other data of the received product information inquiry request and feed back the processing result to the terminal equipment.
It should be noted that, the method for automatically switching the number segments provided in the embodiment of the present invention is generally executed by the server 805, and accordingly, the device for automatically switching the number segments is generally disposed in the server 805.
It should be understood that the number of terminal devices, networks and servers in fig. 8 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
According to an embodiment of the invention, the invention further provides an electronic device and a computer readable medium.
The electronic equipment of the embodiment of the invention comprises: one or more processors; and the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are enabled to realize the method for automatically switching the number segments according to the embodiment of the invention.
A computer readable medium of an embodiment of the present invention has stored thereon a computer program which, when executed by a processor, implements a method for automatically switching segments as proposed by the embodiment of the present invention.
Referring now to FIG. 9, there is illustrated a schematic diagram of a computer system 900 suitable for use in implementing an embodiment of the present invention. The terminal device shown in fig. 9 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 9, the computer system 900 includes a central processing module (CPU) 901 that can execute various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 902 or a program loaded from a storage section 908 into a Random Access Memory (RAM) 903. In the RAM903, various programs and data necessary for the operation of the system 900 are also stored. The CPU901, ROM902, and RAM903 are connected to each other through a bus 904. An input/output (I/O) interface 905 is also connected to the bus 904.
The following components are connected to the I/O interface 905: an input section 906 including a keyboard, a mouse, and the like; an output portion 907 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage portion 908 including a hard disk or the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as needed. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on the drive 910 so that a computer program read out therefrom is installed into the storage section 908 as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from the network via the communication portion 909 and/or installed from the removable medium 911. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a central processing module (CPU) 901.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a unit, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present invention may be implemented in software or in hardware. The described units may also be provided in a processor, for example, described as: a processor, comprising: the names of these units do not constitute a limitation on the unit itself in some cases, and for example, the "number generation module" may also be described as "a module for generating a current number".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include: generating a current number according to a first number segment rule, recording a log of the current number, updating a record of a maximum number, and storing the maximum number into a cache; if the maximum number acquired from the cache exceeds the early warning threshold value of the first number segment rule, determining a second number segment rule according to the number segment configuration information in the number segment configuration rule; and if the maximum number acquired from the cache is the last number generated according to the first number segment rule, taking the second number segment rule as a new first number segment rule.
According to the technical scheme of the embodiment of the invention, the technical means of dynamically monitoring the use condition of the number segments in real time by setting the early warning threshold value to determine the new number segment rule in advance is adopted, so that the technical problems that the utilization rate of the old number segments is insufficient and the new number segments are not timely or even fail to be switched in the process of manually switching the number segments or changing the rule by a configuration mode are solved, the new number segments are smoothly switched to the new number segments directly according to the new number segment rule after the original number segments are exhausted, the waste of the old number segments is avoided, and meanwhile, the technical effect of smooth and non-perception switching is achieved.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (12)

1. A method for automatically switching number segments, comprising:
generating a current number according to a first number segment rule, recording a log of the current number, updating a record of a maximum number, and storing the maximum number into a cache;
if the maximum number acquired from the cache exceeds the early warning threshold value of the first number segment rule, determining a second number segment rule according to the number segment configuration information in the number segment configuration rule;
and if the maximum number acquired from the cache is the last number generated according to the first number segment rule, taking the second number segment rule as a new first number segment rule.
2. The method of claim 1, wherein the determining a second number segment rule based on the number segment configuration information in the number segment configuration rule comprises:
determining a preparation number segment rule according to the number segment configuration information in the number segment configuration rule;
judging whether the preparation number segment rule meets the verification requirement, and if so, taking the preparation number segment rule as a second number segment rule.
3. The method of claim 2, wherein the determining the preliminary segment rule based on the segment configuration information in the segment configuration rule comprises:
obtaining number segment configuration information in a number segment configuration rule, wherein the number segment configuration information comprises: number segment prefix, number segment range, early warning threshold value and reminding mode;
and determining a preparation number segment rule according to the number segment prefix, the number segment range, the early warning threshold value and the reminding mode.
4. A method according to claim 3, wherein the validation requirement comprises:
the prepared number generated according to the prepared number segment rule is different from the historical number;
the prefix of the prepared number is consistent with the prefix of the number segment in the prepared number segment rule;
the prepared number is in the range of the number segment of the prepared number segment rule.
5. A method according to claim 3, further comprising, after said generating the current number according to the first number segment rule:
if the current number exceeds the early warning threshold value of the first number segment rule, an early warning log of the first number segment rule is generated;
if the early warning log of the first segment rule is generated, judging whether the second segment rule is determined, if not, alarming in a reminding mode in the first segment rule, and configuring the second segment rule in a manual mode.
6. An apparatus for automatically switching a number segment, comprising:
the number generation module is used for: generating a current number according to a first number segment rule, recording a log of the current number, updating a record of a maximum number, and storing the maximum number into a cache;
a processing module for: if the maximum number acquired from the cache exceeds the early warning threshold value of the first number segment rule, determining a second number segment rule according to the number segment configuration information in the number segment configuration rule;
a switching module, configured to: and if the maximum number acquired from the cache is the last number generated according to the first number segment rule, taking the second number segment rule as a new first number segment rule.
7. The apparatus of claim 6, wherein the processing module is further configured to:
determining a preparation number segment rule according to the number segment configuration information in the number segment configuration rule;
judging whether the preparation number segment rule meets the verification requirement, and if so, taking the preparation number segment rule as a second number segment rule.
8. The apparatus of claim 7, wherein the processing module is further configured to:
obtaining number segment configuration information in a number segment configuration rule, wherein the number segment configuration information comprises: number segment prefix, number segment range, early warning threshold value and reminding mode;
and determining a preparation number segment rule according to the number segment prefix, the number segment range, the early warning threshold value and the reminding mode.
9. The apparatus of claim 8, wherein the processing module is further configured to determine the validation requirement:
the prepared number generated according to the prepared number segment rule is different from the historical number;
the prefix of the prepared number is consistent with the prefix of the number segment in the prepared number segment rule;
the prepared number is in the range of the number segment of the prepared number segment rule.
10. The apparatus of claim 8, wherein the processing module is further configured to:
if the current number exceeds the early warning threshold value of the first number segment rule, an early warning log of the first number segment rule is generated;
if the early warning log of the first segment rule is generated, judging whether the second segment rule is determined, if not, alarming in a reminding mode in the first segment rule, and configuring the second segment rule in a manual mode.
11. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-5.
12. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-5.
CN201910406057.4A 2019-05-16 2019-05-16 Method and device for automatically switching number segments Active CN111950232B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910406057.4A CN111950232B (en) 2019-05-16 2019-05-16 Method and device for automatically switching number segments

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910406057.4A CN111950232B (en) 2019-05-16 2019-05-16 Method and device for automatically switching number segments

Publications (2)

Publication Number Publication Date
CN111950232A CN111950232A (en) 2020-11-17
CN111950232B true CN111950232B (en) 2023-09-05

Family

ID=73335473

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910406057.4A Active CN111950232B (en) 2019-05-16 2019-05-16 Method and device for automatically switching number segments

Country Status (1)

Country Link
CN (1) CN111950232B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114553824B (en) * 2021-12-31 2024-04-19 深圳市梦网科技发展有限公司 Maintenance method, system, terminal equipment and medium for enterprise channel number

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102436479A (en) * 2011-10-12 2012-05-02 远光软件股份有限公司 Method and system for generating globally unique data identifier
JP2012114748A (en) * 2010-11-25 2012-06-14 Ntt Docomo Inc Telephone number management system and telephone number management method
US9262741B1 (en) * 2015-04-28 2016-02-16 Codeshelf Continuous barcode tape based inventory location tracking
CN109376155A (en) * 2018-11-06 2019-02-22 泰康保险集团股份有限公司 ID generation method and device, storage medium and electronic equipment
CN109388626A (en) * 2017-08-04 2019-02-26 北京京东尚科信息技术有限公司 Method and apparatus for being numbered to traffic assignments
CN109408481A (en) * 2018-11-06 2019-03-01 北京字节跳动网络技术有限公司 Update method, device, electronic equipment and the readable medium of log collection rule
CN109472420A (en) * 2018-11-19 2019-03-15 国家电网公司 The optimization method and device of number resource

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012114748A (en) * 2010-11-25 2012-06-14 Ntt Docomo Inc Telephone number management system and telephone number management method
CN102436479A (en) * 2011-10-12 2012-05-02 远光软件股份有限公司 Method and system for generating globally unique data identifier
US9262741B1 (en) * 2015-04-28 2016-02-16 Codeshelf Continuous barcode tape based inventory location tracking
CN109388626A (en) * 2017-08-04 2019-02-26 北京京东尚科信息技术有限公司 Method and apparatus for being numbered to traffic assignments
CN109376155A (en) * 2018-11-06 2019-02-22 泰康保险集团股份有限公司 ID generation method and device, storage medium and electronic equipment
CN109408481A (en) * 2018-11-06 2019-03-01 北京字节跳动网络技术有限公司 Update method, device, electronic equipment and the readable medium of log collection rule
CN109472420A (en) * 2018-11-19 2019-03-15 国家电网公司 The optimization method and device of number resource

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
物流终端管理系统;温庆余;李艳;;电脑知识与技术(06);140-141+144 *

Also Published As

Publication number Publication date
CN111950232A (en) 2020-11-17

Similar Documents

Publication Publication Date Title
US10019255B1 (en) Incremental software deployment in a service environment
CN111198813A (en) Interface testing method and device
CN110795147A (en) Interface protocol file management method and device
CN107315672B (en) Method and device for monitoring server
CN111950232B (en) Method and device for automatically switching number segments
CN111800223B (en) Method, device and system for generating sending message and processing receiving message
CN110737655B (en) Method and device for reporting data
CN115296979B (en) Fault processing method, device, equipment and storage medium
CN111831503B (en) Monitoring method based on monitoring agent and monitoring agent device
CN111198853B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN112948138A (en) Method and device for processing message
CN114049065A (en) Data processing method, device and system
CN113132447A (en) Reverse proxy method and system
CN114465919A (en) Network service testing method, system, electronic equipment and storage medium
CN112783903B (en) Method and device for generating update log
CN112711572B (en) Online capacity expansion method and device suitable for database and table division
CN114064803A (en) Data synchronization method and device
CN113760568A (en) Data processing method and device
CN113722193A (en) Method and device for detecting page abnormity
CN113760712A (en) Test evaluation method and device
CN110262756B (en) Method and device for caching data
CN111179097B (en) Method, device, electronic equipment and storage medium for modifying warranty
CN109871310B (en) Version quality testing method and device
CN115471168B (en) Automated process processing method, apparatus, electronic device and computer readable medium
CN115292081B (en) Information sending method, device, electronic equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210305

Address after: 6 / F, 76 Zhichun Road, Haidian District, Beijing 100086

Applicant after: Beijing Jingdong Zhenshi Information Technology Co.,Ltd.

Address before: 101, 1st floor, building 2, yard 20, Suzhou street, Haidian District, Beijing 100080

Applicant before: Beijing Jingbangda Trading Co.,Ltd.

Effective date of registration: 20210305

Address after: 101, 1st floor, building 2, yard 20, Suzhou street, Haidian District, Beijing 100080

Applicant after: Beijing Jingbangda Trading Co.,Ltd.

Address before: 100086 8th floor, 76 Zhichun Road, Haidian District, Beijing

Applicant before: BEIJING JINGDONG SHANGKE INFORMATION TECHNOLOGY Co.,Ltd.

Applicant before: BEIJING JINGDONG CENTURY TRADING Co.,Ltd.

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant