Number processing method, apparatus, device, and storage medium

By dividing user numbers into two segments, general and special, deleting the general segment and storing them in the order of the special segment, the problems of high memory consumption and slow query speed in the existing technology are solved, and efficient number query and storage are achieved.

CN116887204BActive Publication Date: 2026-08-04SHENZHEN MONTNETS TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN MONTNETS TECH CO LTD
Filing Date
2023-07-21
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Existing technologies suffer from high memory consumption and slow query speed when querying whether a large number of user numbers support receiving smart SMS messages, which affects the user experience.

Method used

User numbers are divided into two segments: general and special. Information from the general segment is deleted, and only information from the special segment is stored. The special segment information is stored in an array according to its numerical order, and the special segment is used as a query index for querying.

Benefits of technology

It saves a significant amount of memory space, improves storage and query speed, and enhances query efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116887204B_ABST
    Figure CN116887204B_ABST
Patent Text Reader

Abstract

This application relates to the field of communication technology and provides a number processing method, apparatus, device, and storage medium. The method includes: acquiring user number information to be stored that has the function of receiving smart SMS messages, wherein the user number information to be stored includes first number segment information to be stored and second number segment information to be stored, wherein the first number segment information to be stored is general information for each user number to be stored, and the second number segment information to be stored is specific information for each user number to be stored; deleting the first number segment information to be stored; and storing the user number information to be stored sequentially in a preset array according to the numerical order of the second number segment information to be stored. This solution saves memory space and improves query speed in subsequent queries by customizing and storing the user numbers to be stored.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a number processing method, apparatus, device and storage medium. Background Technology

[0002] With the rollout of 5G technology, user terminals are receiving SMS messages in more diverse formats. Currently, most smartphones can receive AI Messages (AIM), which are rich in content and come in various forms, including but not limited to single image / text messages, multi-image / text messages, audio / video messages, and application links. Typically, when sending an AIM message to a user terminal, the gateway needs to query in real-time whether the user's phone number has the capability to receive AIM messages.

[0003] In the relevant scheme, the user terminal's corresponding user number and other information are stored sequentially in the computer. When the gateway queries, it checks whether the user number can receive AIM messages in the order of the user number.

[0004] However, when the number of user numbers to be queried is large, the above storage and query methods will result in slow query speed and high memory consumption, which will affect the user experience. Summary of the Invention

[0005] This application provides a number processing method, apparatus, device, and storage medium that can solve the technical problems of how to save memory space and improve query speed.

[0006] In a first aspect, embodiments of this application provide a number processing method, the method comprising:

[0007] Obtain user number information that is capable of receiving smart SMS messages;

[0008] The user number information to be stored includes the first number segment information to be stored and the second number segment information to be stored. The first number segment information to be stored is general information for each user number to be stored, while the second number segment information to be stored is specific information for each user number to be stored.

[0009] Delete the first segment of information to be stored;

[0010] The user number information to be stored is stored sequentially in a preset array according to the numerical order of the second segment information to be stored.

[0011] This storage method saves a lot of memory space and improves storage speed when storing user number information in batches, especially in large quantities. By deleting the first segment of information to be stored and then storing the remaining second segment of information, the storage speed can be improved. At the same time, the amount of content to be searched can be reduced in subsequent queries, which helps to improve the query speed.

[0012] In one embodiment, the above number processing method further includes:

[0013] Retrieve the user's phone number information to be queried, which includes the first number segment information and the second number segment information to be queried.

[0014] Delete the information in the first segment of the query;

[0015] Use the value of the second segment information to be queried as the query index to search in the preset array;

[0016] When the array corresponding to the query index is found in the preset array, it is determined that the user number corresponding to the user number information to be queried has the function of receiving smart SMS.

[0017] Using this query method, the dedicated second segment information to be queried can be used as a query index to quickly locate the corresponding array, which helps to improve query efficiency.

[0018] In one embodiment, the above number processing method further includes:

[0019] Obtain the manufacturer name and software development kit version number of the user terminal corresponding to the user number information to be stored;

[0020] The manufacturer name information and the software development kit version number information are merged and stored as an array value corresponding to the user number information to be stored. The manufacturer name information and the software development kit version number information are used to determine whether the user number corresponding to the user number information to be queried can receive smart SMS.

[0021] In one embodiment, the above number processing method further includes:

[0022] When the array value is not equal to 0, it is determined that the user number corresponding to the user number information in the array can receive smart SMS messages;

[0023] When the array value is equal to 0, it is determined that the user number corresponding to the user number information in the array cannot receive smart SMS messages.

[0024] In one embodiment, obtaining the user's phone number information to be queried includes:

[0025] Obtain the request packet corresponding to the user number information to be queried. The request packet includes a request header and a request body. The request header includes authentication information, and the request body includes at least one user number information to be authenticated.

[0026] Based on the authentication information, determine whether to query the user's number information to be authenticated in the preset array.

[0027] In one embodiment, determining whether to query the user number information to be authenticated in a preset array based on the authentication information includes:

[0028] When the authentication information passes, the request packet is parsed to obtain the user number information to be authenticated from the request body, and the user number information to be authenticated is queried in the preset array.

[0029] If the authentication information fails, the corresponding request packet is not parsed, and the authentication information of the next request packet is checked to see if it passes, until the authentication information passes.

[0030] In one embodiment, the above number processing method further includes:

[0031] When adding and / or deleting user number information to be stored in the preset array, the corresponding change instruction is appended to the AOF file, and all user number information to be stored is saved locally;

[0032] When user number information to be stored is lost, the data is recovered based on the AOF file.

[0033] In one embodiment, before recovering data from the AOF file, the above-mentioned number processing method further includes:

[0034] After restarting, load the file corresponding to the user number information to be stored that is stored locally, and load the AOF file.

[0035] By utilizing AOF files, user data security can be ensured and user data loss can be prevented.

[0036] Secondly, embodiments of this application provide a number processing apparatus that has the function of implementing the method in the first aspect or any possible implementation thereof. Specifically, the apparatus includes units for implementing the method in the first aspect or any possible implementation thereof.

[0037] In one embodiment, the device includes:

[0038] The acquisition unit is used to acquire user number information to be stored that has the function of receiving smart SMS messages. The user number information to be stored includes first number segment information to be stored and second number segment information to be stored. The first number segment information to be stored is general information for each user number, and the second number segment information to be stored is specific information for each user number.

[0039] The processing unit is used to delete the first segment information to be stored;

[0040] The storage unit is used to sequentially store the user number information to be stored in a preset array according to the numerical order of the second number segment information to be stored.

[0041] Thirdly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it causes the computer device to implement any of the implementation methods of the first aspect described above.

[0042] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a computer device, causes the computer device to implement the method of any of the implementations of the first aspect described above.

[0043] Fifthly, embodiments of this application provide a computer program product that, when run on a computer device, causes the computer device to execute any of the implementation methods of the first aspect described above.

[0044] The beneficial effects of the embodiments in this application compared with the prior art are:

[0045] By dividing the user numbers to be stored into a first segment and a second segment, deleting the general information of the first segment and storing only the dedicated information of the second segment, redundant data can be eliminated, significantly saving memory space. At the same time, the query content can be reduced during the query, which helps to improve query efficiency. Attached Figure Description

[0046] Figure 1 This is a schematic diagram illustrating a scenario provided in this application embodiment for querying whether a user's number supports receiving AIM messages.

[0047] Figure 2 This is a schematic diagram of a number storage process provided in an embodiment of this application.

[0048] Figure 3 This is a flowchart illustrating another number storage method provided in an embodiment of this application.

[0049] Figure 4This is a schematic diagram of a number storage structure provided in an embodiment of this application.

[0050] Figure 5 This is a flowchart illustrating a number lookup method provided in an embodiment of this application.

[0051] Figure 6 This is a flowchart illustrating another number storage method provided in an embodiment of this application.

[0052] Figure 7 This is a schematic diagram of the device provided in the embodiments of this application.

[0053] Figure 8 This is a schematic diagram of the structure of the computer device provided in the embodiments of this application. Detailed Implementation

[0054] AI Message (AIM), also known as rich media card message, is an upgraded form of traditional SMS. User terminals use intelligent parsing to transform ordinary text messages into rich media messages, displaying various media elements such as images, audio, video, and payment links. Upon receiving an AIM message, users can access various functions, including built-in browser access, opening mini-programs, and quick payments, enhancing the real-time experience of application interaction. For example, a seller can send an AIM message containing a shopping link to a user's terminal; after receiving the AIM message, the user can click the link to be redirected to a shopping website to make a purchase.

[0055] Typically, when sending an AIM message to a user terminal, the system checks whether the user number corresponding to the user terminal supports receiving the AIM message.

[0056] The following is combined Figure 1 This section will explain in detail the application scenarios for querying whether the user number corresponding to the user terminal supports receiving the AIM message.

[0057] Figure 1 This is a schematic diagram illustrating a scenario provided in this application embodiment for querying whether a user's number supports receiving AIM messages.

[0058] like Figure 1 As shown, Figure 1 This includes: gateway, query interface, and synchronization server.

[0059] A gateway is a network interconnect device that connects different networks to enable data exchange and management. As an example, and not a limitation, the gateway here could be a 5G gateway. A 5G gateway is a gateway device that can connect to either a 5G wired network or a 5G wireless network. Using a 5G gateway can achieve high-speed data transmission, reduce latency, and greatly improve the user experience.

[0060] A query interface can be understood as an interface that provides a way to check whether a user's number supports the AIM messaging service. An interface is a channel connecting different systems, enabling communication and data exchange between them. It is typically used for connecting to databases, querying third-party services, and retrieving data. When using it, the caller accesses existing data in the system or service through the interface, performs operations such as querying, modifying, and deleting this data, and then returns the results to the caller. As an example and not a limitation, the query interface here can be an HTTP interface, an API interface, or any other interface that can achieve the same functionality.

[0061] A synchronization server refers to a computer device or server that provides a user number synchronization service based on client requests. As an example and not a limitation, the synchronization server here could be a server capable of retrieving user numbers that support receiving AIM messages from the internet and sending them to a query interface in real time.

[0062] In one implementation, the query interface retrieves information on user numbers that support receiving AIM messages from a synchronization server in real time via the internet and automatically saves it to the local file system. When an AIM message needs to be sent to a user terminal, the gateway sends a query request instruction to the query interface. The query interface receives the instruction and determines whether a corresponding user number can be found in the file system (i.e., performs a user number lookup and comparison), and then sends the result back to the gateway. Finally, based on the result, it can be determined whether a user number supports AIM messages.

[0063] This can also be understood as follows: if the corresponding user number can be found in the file system, it means that the number supports AIM messages; if the corresponding user number cannot be found in the file system, it means that the number does not support AIM messages.

[0064] Based on the above scenarios, it is understandable that using the traditional method of storing and querying numbers not only leads to serious memory space consumption problems, but also results in slow query speed, making it difficult to meet market demands.

[0065] To address the aforementioned issues, this application proposes a number processing method that can improve the efficiency of querying user numbers while saving storage space.

[0066] To further illustrate the technical solution of this application, specific embodiments are described below.

[0067] Figure 2 This is a schematic diagram of a number storage process provided in an embodiment of this application.

[0068] like Figure 2 As shown, the above number storage method includes the following steps S201 to S207.

[0069] S201. Obtain the user number information to be stored that has the function of receiving smart SMS messages.

[0070] The user number information to be stored includes the first number segment information to be stored and the second number segment information to be stored. The first number segment information is general information for each user number to be stored, while the second number segment information is specific information for each user number to be stored.

[0071] This can also be understood as follows: the first segment of information to be stored is information that every user number to be stored has, and this information cannot be used to distinguish different user numbers; while the second segment of information to be stored can represent the differences between each user number to be stored, and is used to distinguish different user numbers.

[0072] As an example, not a limitation, following the numbering rules of domestic mobile phone numbers, one user number to be stored could be "10000000001" and another could be "10000000002". Dividing these 11-digit mobile phone numbers into two segments, the first segment to be stored is chosen as "1", and the second segment is chosen as either "0000000001" or "0000000002". It is clear that the first segment is a universal segment for every mobile phone number, while the second segment is a unique segment specific to each mobile phone number. Therefore, the second segment can be used to distinguish mobile phone users who support receiving AIM messages.

[0073] It is understandable that the first segment to be stored mentioned here could also take other forms.

[0074] In one implementation, the first number segment to be stored and the second number segment to be stored can be determined based on the numerical range of the user number information to be stored.

[0075] For example, assuming the distribution range of user numbers to be stored is "18800000001" to "18800009999", the first number segment to be stored is "1880000", and the second number segment to be stored can be specifically selected from "0001" to "9999" according to the actual situation.

[0076] For example, suppose the distribution range of user numbers to be stored is "10011111111" to "11000000999". This batch of numbers can be divided into two categories: the first category is the range "10011111111" to "10999999999", and the second category is the range "1100000000" to "11000000999". In the first category, the first segment to be stored is "10", and the second segment can be selected from "011111111" to "999999999" depending on the actual situation. Similarly, in the second category, the first segment to be stored is "11000000", and the second segment can be selected from "000" to "999" depending on the actual situation.

[0077] In other words, when storing data, the user numbers to be stored can be sorted by size in advance, and then, based on the actual situation, it can be determined which number segments are general number segments and which are special number segments, that is, the first number segment to be stored and the second number segment to be stored can be determined.

[0078] In one implementation, user number information that can receive smart SMS messages can be obtained from a locally stored file system, or it can be obtained in real time from other computer devices or servers via the Internet. The source of the user number information is not limited here, and can be selected according to the actual situation.

[0079] S202. Delete the information of the first segment to be stored.

[0080] Based on the above, it can be understood that the first segment of information to be stored (such as "1" mentioned above) does not have the function of distinguishing different users. Therefore, this information can be deleted and is not required to be stored.

[0081] As an example rather than a limitation, when storing "10000000001", you can delete the "1" and only store "0000000001".

[0082] S203. Store the user number information to be stored in a preset array in order of the numerical value of the second number segment information to be stored.

[0083] It is understandable that the second segment of information to be stored (such as "0000000001" mentioned above) has a numerical order. When storing, it can be stored in ascending or descending order. Because "0000000002" is numerically larger than "0000000001", it is stored first, followed by "0000000001".

[0084] In one implementation, the information of the second segment to be stored can be stored as an array index in a preset array.

[0085] As an example, and not a limitation, arrays can be represented in the following format when storing data. For example, array[0] represents the user number 10000000000, which can be represented by the following array:

[0086] Array[0]=Data of 10000000000.

[0087] Similarly, we can conclude that:

[0088] Array[1]=Data of 10000000001;

[0089] ...

[0090] Array[3588888888]=Data of 13588888888;

[0091] Array[9999999999]=Data of 19999999999.

[0092] Based on the above, when storing the user numbers "10000000001" and "10000000002", first delete the "1", then store "0000000001" as the array index in the preset array, and continue storing "0000000002" in the same way. It can be clearly seen that this storage method saves 10 times the memory space compared to directly storing "10000000001".

[0093] This storage method saves a lot of memory space and improves storage speed when storing user number information in batches, especially in large quantities. By deleting the first segment of information to be stored and then storing the remaining second segment of information, the storage speed can be improved. At the same time, the amount of content to be searched can be reduced in subsequent queries, which helps to improve the query speed.

[0094] When it is necessary to determine whether a user number can receive AIM messages, the corresponding number can be found in a preset array.

[0095] The following describes a number lookup method provided by an embodiment of this application. The method includes the following steps S204 to S207.

[0096] S204. Obtain the user number information to be queried.

[0097] The user number information to be queried includes information on the first number segment and information on the second number segment.

[0098] In one implementation, an HTTP request can be received to obtain the user information to be queried, and the specific user number can be obtained by further parsing the HTTP request packet.

[0099] An HTTP request is a request sent by a client to a server to obtain a resource or perform an operation. It is an application layer protocol that defines the communication specifications between clients and servers.

[0100] Generally, an HTTP request includes a request method, request headers, request body, and request parameters. Common request methods include GET, POST, PUT, and DELETE. GET can be understood as a retrieval operation, POST as a creation operation, PUT as an update operation, and DELETE as a deletion operation.

[0101] The request header contains metadata about the request and the client, such as the user agent (UA).

[0102] The request body varies depending on the request method. For example, the request body in the POST method is generally used to transmit form data, JSON data, etc.

[0103] In one implementation, the query interface can use the HTTP+JSON protocol for interaction. This approach facilitates integration by most programming languages, lowers the barrier to entry, and thus broadens the application scope of the query interface while reducing development costs.

[0104] S205. Delete the information in the first segment to be queried.

[0105] Similar to the principle of storing the first number segment information mentioned above, the first number segment information to be queried in the user number information to be queried is deleted.

[0106] For example, when querying user number "10000000001", you can delete the "1".

[0107] S206. Use the value of the second segment information to be queried as the query index to perform a query in the preset array.

[0108] Similar to the principle of storing the second segment information mentioned above, when querying the user number "10000000001", the "1" is deleted, and "0000000001" is kept. "0000000001" is then used as the query index to perform a query in the preset array.

[0109] S207. When the array corresponding to the query index is found in the preset array, it is determined that the user number corresponding to the user number information to be queried has the function of receiving smart SMS.

[0110] Based on the above, it can be understood that the preset array stores user numbers that are capable of receiving smart SMS messages. If a corresponding number can be found in the preset array, it means that the number can receive smart SMS messages.

[0111] As an example rather than a limitation, an array Array[1] is stored in the preset array, which represents the user number "10000000001". Assuming that the number to be queried is "10000000001", after removing "1", "0000000001" (i.e., the value 1) is used as the query index to search in the preset array. After the search, "Array[1]" is found. At this time, it means that the number to be queried "10000000001" can receive AIM messages.

[0112] Conversely, if the obtained query number is “10000000002”, after removing “1”, “0000000002” (i.e., the value 2) is used as the query index to query in the preset array. After the query, the corresponding array “Array[2]” cannot be found, indicating that the query number “10000000002” cannot receive AIM messages.

[0113] By using the specific information of the number to be queried as a query index, the specific storage location can be quickly located. At the same time, it can avoid searching for general information, reduce the content to be searched, and improve query speed.

[0114] Figure 3 This is a flowchart illustrating another number storage method provided in an embodiment of this application. For example... Figure 3 As shown, Figure 3 The steps include S301 to S304.

[0115] S301. Obtain the manufacturer name information and software development kit version number information of the user terminal corresponding to the user number information to be stored.

[0116] Typically, along with storing the user's number, the vendor ID and SDK (Software Development Kit) version number of the user's terminal corresponding to that user number are also saved.

[0117] The vendor ID here refers to the ID number of the manufacturer corresponding to the user terminal, usually represented by 3 digits. For example, the vendor ID corresponding to a certain user terminal brand is 001.

[0118] The SDK version number here refers to the SDK version number identified on the terminal device, which is related to the display of AIM messages. For example, a 5-digit SDK version number can be used; this can be chosen according to the actual situation and is not limited.

[0119] S302. Combine the manufacturer name information and the software development kit version number information and store them as an array value corresponding to the user number information to be stored.

[0120] The vendor name and software development kit (SDK) version number can be used to determine whether a user number corresponding to the queried user number can receive SMS messages. By merging and storing the vendor name and SSD version number information into an array of values ​​corresponding to the user number, the system can determine whether a user number can receive SMS messages by querying the values ​​in the array.

[0121] The following is combined Figure 4 Let me explain in detail.

[0122] Figure 4 This is a schematic diagram of a number storage structure provided in an embodiment of this application. Wherein, Figure 4 Part A in the diagram is a schematic diagram of the storage structure in this application, and Part B is a schematic diagram of the storage structure in a conventional scheme.

[0123] Combination Figure 4 In part A of the diagram, assuming a user number is 10000000001, when storing the data, the "1" can be removed, and the remaining digits can be used as array indices. The data can then be stored in memory in numerical order. Correspondingly, the vendor ID and SDK version number of the user terminal to which the user number belongs are the values ​​of the array corresponding to that user number.

[0124] As an example, not a limitation, given that Array[3588888888] = Data of 13588888888, then Data of 13588888888 = 3 bits for Vendor ID + 5 bits for SDK Version. It can be understood that "Array[3588888888]" represents a query for the value of the number 13588888888, and the query result is the 3-digit vendor ID and 5-digit SDK version number corresponding to that user number.

[0125] Combination Figure 4 Part B in the diagram is a traditional storage structure diagram. Figure 4As can be seen, the traditional storage structure consists of 1 byte for the phone number, 1 byte for the manufacturer ID, and 1 byte for the SDK version number. This storage structure consumes a lot of memory and has a slow query speed. For a large number of numbers, it requires a lot of storage space and cannot meet the needs of fast number retrieval. Furthermore, when adding or deleting numbers, the memory usage of this storage method fluctuates greatly and is unstable.

[0126] Compared to traditional storage structures, storing user numbers using the compressed storage structure described above saves 10 times the memory space compared to storing user numbers directly in memory, thus improving storage performance. Simultaneously, locating the corresponding storage result using the number itself as an index improves query speed. Furthermore, requiring only 1 byte to store the number, this compressed storage structure ensures stable, low-latency updates in memory during number additions and deletions.

[0127] S303. When the array value is not equal to 0, it is determined that the user number corresponding to the user number information in the array can receive smart SMS messages.

[0128] As an example, not a limitation, when the user number to be queried is "13588888888", first delete the first segment "1" to be queried, and use the second segment "3588888888" as the query index to search in the preset array. Find the array "Array[3588888888]", and then get the array value "3bits for Vendor ID + 5bits for SDKVersion". At this time, the value of "3bits for Vendor ID + 5bits for SDK Version" is not equal to 0, which means that the user number information corresponding to the array can receive smart SMS, that is, the mobile phone number "13588888888" can receive smart SMS.

[0129] S304. When the array value is equal to 0, it is determined that the user number corresponding to the user number information in the array cannot receive smart SMS messages.

[0130] As an example, not a limitation, when the user number to be queried is "13588888888", first delete the first segment "1" to be queried, and use the second segment "3588888888" as the query index to search in the preset array. Find the array "Array[3588888888]", and then get the array value "3bits for Vendor ID + 5bits for SDKVersion". At this time, the value of "3bits for Vendor ID + 5bits for SDK Version" is equal to 0, which means that the user number information corresponding to this array cannot receive smart SMS, that is, the mobile phone number "13588888888" cannot receive smart SMS.

[0131] When retrieving a user's phone number, authentication is usually required first. The following section combines... Figure 5 Let me explain in detail.

[0132] Figure 5 This is a flowchart illustrating a number lookup method provided in an embodiment of this application. Figure 5 As shown, the process includes the following steps S501 to S504.

[0133] S501. Obtain the request packet corresponding to the user number information to be queried.

[0134] The request packet includes a request header and a request body. The request header includes authentication information, and the request body includes at least one user number to be authenticated.

[0135] In one implementation, the encoding format is UTF-8 (Unicode Transformation Format 8-bit). This encoding format is a variable-width encoding format that uses 1 to 4 bytes to represent a Unicode character.

[0136] In one implementation, the request packet uses the POST method. A POST request can send data to the server and can create new content.

[0137] In one implementation, the protocol type is:

[0138] Content-Type: application / json; charset=UTF-8.

[0139] The following section, in conjunction with Table 1, will provide a detailed explanation of some of the contents of the request header.

[0140] As shown in Table 1, the required parameters in the request header include: account, pwd, and timestamp, all of which are of type String. Here, account represents the user account, pwd represents the user's plaintext password, which is then encrypted into a string according to the rules, and timestamp represents the dynamic time.

[0141] Table 1

[0142] account String Required Access user account pwd String Required Access user's plaintext password, and encrypt the string according to the rules. timestamp String Required Dynamic Time

[0143] The following section, in conjunction with Table 2, illustrates part of the format of the request body.

[0144] As shown in Table 2, the required parameters in the request body include the parameter name (i.e., the collection of parameter objects), the parameter itself (i.e., the user's mobile phone number), and the data type (List). <object>This field is required and indicates that the request body can receive 0 to 10,000 mobile phone numbers.

[0145] Table 2

[0146]

[0147] As can be seen from Table 2, the request parameters of this request body support batch number query, which can transmit multiple user numbers at once, thus improving performance.

[0148] S502. Determine whether to query the user number information to be authenticated in the preset array based on the authentication information.

[0149] When receiving an HTTP request packet, authentication information can be used to authenticate the packet header. If the authentication is successful, the subsequent query steps will continue; if the authentication fails, the subsequent query steps will not be executed.

[0150] As an example rather than a limitation, the authentication methods mentioned above can be Basic Authentication, Digest Authentication, etc.

[0151] Basic authentication involves adding an Authorization field to the request header. Authorization is an HTTP security request header that contains data provided by the client to the server to facilitate authentication. Here, the value of the Authorization field is a Base64 encoded version of the username and password. By decoding this Authorization field and comparing it with the stored username and password, the authentication result can be determined.

[0152] Digest authentication involves adding an Authorization field to the request header. The value of the Authorization field includes: username, server domain (usually a string), a random string generated by the server, and a response digest generated by the client, etc. The correctness of the aforementioned response digest can be verified by a digest algorithm to determine whether the authentication has passed.

[0153] The specific authentication method can be selected and applied according to security requirements, and this is just an example and not a limitation.

[0154] S503. When the authentication information passes, parse the request packet, obtain the user number information to be authenticated in the request body, and query the user number information to be authenticated in the preset array.

[0155] As an example, not a limitation, let's assume that the basic authentication method is used for authorization. By decoding the Authorization field, the corresponding Basic base64 value is obtained. This Basic base64 value is then compared with the stored username and password. If the username and password match, the authentication information is successful.

[0156] Based on the above, when the authentication information passes, the request packet is further parsed to obtain the user number information to be authenticated in the request body, and the user number information to be authenticated is queried in the preset array. The specific query process is as shown in the example above, and will not be repeated here.

[0157] S504. When the authentication information fails, the corresponding request packet is not parsed, and the authentication information of the next request packet is checked to see if it passes, until the authentication information passes.

[0158] For illustrative purposes only, and not as a limitation, let's assume that basic authentication is used. By decoding the `Authorization` field, the corresponding `Basic base64` value is obtained. This `Basic base64` value is compared with the stored username and password. If the username and password do not match, the authentication fails. The corresponding request packet is not parsed at this point; instead, the process moves directly to checking the authentication information of the next request packet. Parsing only begins after successful authentication. This method avoids parsing invalid data, improving parsing efficiency.

[0159] Compared to placing authentication information in the packet body, the above method of authenticating the request packet header does not require parsing the request body (HTTP BODY), making it easier to achieve information distribution and shorten query time.

[0160] Figure 6 This is a flowchart illustrating another number storage method provided in an embodiment of this application. For example... Figure 5 As shown, the process includes the following steps S601 to S602.

[0161] S601. When adding and / or deleting user number information to be stored in the preset array, the corresponding change instruction is appended to the AOF file, and all user number information to be stored is saved locally.

[0162] An AOF (Append-Only File) file is a file format used for persistent storage of database operation logs. It records the write operation commands executed by the database, as well as the parameters and data carried by these commands.

[0163] AOF files can be implemented in append-only mode. In append-only mode, each time a write operation command is executed, a remote dictionary server (Redis) can be used to append the command as text to the end of the AOF file.

[0164] In one implementation, each time user number information to be stored is added and / or deleted in the preset array, the corresponding add and / or delete instructions are appended to the AOF file, and all user number information to be stored in the preset array is saved to the local file system at 0:00 every night, for example, it can be saved to the local disk.

[0165] S602. When the user number information to be stored is lost, the data is recovered based on the AOF file.

[0166] In one implementation, when the user number information to be stored is lost, the computer device can be restarted, the file corresponding to the user number information to be stored stored locally can be loaded first, and then the AOF file can be loaded.

[0167] AOF files can be used to prevent the loss of user number data stored in computer devices during power outages or system crashes. When the computer is restarted, the file containing the user numbers to be stored is loaded first, followed by the AOF file, thus restoring the data.

[0168] The foregoing mainly describes a number processing method according to an embodiment of this application with reference to the accompanying drawings. It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially, these steps are not necessarily executed in the order shown in the figures. 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 embodiments described above 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 a portion of the steps or stages of other steps. The following describes an apparatus according to an embodiment of this application with reference to the accompanying drawings. For brevity, appropriate omissions will be made when describing the apparatus below; relevant content can be referred to in the relevant descriptions of the methods above, and will not be repeated.

[0169] Figure 7 A schematic diagram of the structure of a number processing device provided in the application embodiment.

[0170] like Figure 7 As shown, the number processing device 1000 includes the following units.

[0171] The acquisition unit 1001 is used to acquire user number information to be stored that has the function of receiving smart SMS messages. The user number information to be stored includes first number segment information to be stored and second number segment information to be stored. The first number segment information to be stored is general information for each user number, and the second number segment information to be stored is specific information for each user number.

[0172] Processing unit 1002 is used to delete the first segment information to be stored.

[0173] Storage unit 1003 is used to store the user number information to be stored in a preset array in the order of the numerical values ​​of the second number segment information to be stored.

[0174] In one implementation, the acquisition unit 1001 can also be used to execute the methods in steps S204, S301 and S501.

[0175] In one implementation, the processing unit 1002 can also be used to execute the methods in steps S205-S207, S302-S304, S502-S504 and S601-S602.

[0176] It should be noted that the information interaction and execution process between the above-mentioned units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.

[0177] Figure 8 This is a schematic diagram of the structure of the computer device provided in an embodiment of this application. Figure 8 As shown, the computer device 3000 of this embodiment includes: at least one processor 3100 ( Figure 8 (Only one is shown) a processor, a memory 3200, and a computer program 3210 stored in the memory 3200 and executable on at least one processor 3100, wherein when the processor 3100 executes the computer program 3210, the computer device performs the steps described in the above embodiments.

[0178] The processor 3100 can be a Central Processing Unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0179] In some embodiments, memory 3200 may be an internal storage unit of computer device 3000, such as a hard disk or RAM of computer device 3000. In other embodiments, memory 3200 may be an external storage device of computer device 3000, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on computer device 3000. Furthermore, memory 3200 may include both internal and external storage units of computer device 3000. Memory 3200 is used to store operating system, application programs, boot loader data, and other programs, such as program code for computer programs. Memory 3200 may also be used to temporarily store data that has been output or will be output.

[0180] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units is merely an example. In practical applications, the above functions can be assigned to different functional units or modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0181] This application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a computer device, it enables the computer device to perform the steps described in the above-described method embodiments.

[0182] This application provides a computer program product that, when run on a computer device, enables the computer device to implement the methods described above.

[0183] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it enables a computer device to implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographing device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0184] It should be understood that the sequence numbers of the steps in the above embodiments do not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. In the description, specific details such as particular system structures and technologies are set forth for illustrative purposes rather than for limiting purposes, so as to provide a thorough understanding of the embodiments of this application. However, those skilled in the art should understand that this application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of this application with unnecessary details.

[0185] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0186] It should also be understood that the term "and / or" as used in this application specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0187] Furthermore, in the description of this application and the appended claims, the terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0188] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0189] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0190] In the embodiments provided in this application, it should be understood that the disclosed apparatus, computer equipment, and methods can be implemented in other ways. For example, the apparatus and computer equipment embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0191] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.< / object>

Claims

1. A number processing method, characterized in that, include: Obtain user number information to be stored that has the function of receiving smart SMS messages. The user number information to be stored includes a first number segment information to be stored and a second number segment information to be stored. The first number segment information to be stored is general information for each user number to be stored, and the second number segment information to be stored is specific information for each user number to be stored. Delete the first segment information to be stored; The user number information to be stored is stored sequentially in a preset array according to the numerical order of the second number segment information to be stored; The method further includes: Obtain the manufacturer name information and software development kit version number information of the user terminal corresponding to the user number information to be stored; The manufacturer name information and the software development kit version number information are merged and stored as an array value corresponding to the user number information to be stored. The manufacturer name information and the software development kit version number information are used to determine whether the user number corresponding to the user number information to be queried has the function of receiving smart SMS. The array value is used to determine whether the user number can receive smart SMS.

2. The method according to claim 1, characterized in that, The method further includes: Obtain the user number information to be queried, which includes the first number segment information and the second number segment information to be queried; Delete the information in the first segment to be queried; The value of the second segment information to be queried is used as the query index to search in the preset array; When the array corresponding to the query index is found in the preset array, it is determined that the user number corresponding to the user number information to be queried has the function of receiving smart SMS.

3. The method according to claim 2, characterized in that, The method further includes: When the array value is not equal to 0, it is determined that the user number corresponding to the user number information in the array can receive smart SMS messages; When the array value is equal to 0, it is determined that the user number corresponding to the user number information in the array cannot receive smart SMS messages.

4. The method according to claim 2, characterized in that, The process of obtaining the user's phone number information to be queried includes: Obtain the request packet corresponding to the user number information to be queried. The request packet includes a request header and a request body. The request header includes authentication information, and the request body includes at least one user number information to be authenticated. Based on the authentication information, determine whether to query the user number information to be authenticated in the preset array.

5. The method according to claim 4, characterized in that, The step of determining whether to query the user number information to be authenticated in the preset array based on the authentication information includes: When the authentication information passes, the request packet is parsed to obtain the user number information to be authenticated in the request body, and the user number information to be authenticated is queried in the preset array. If the authentication information fails, the corresponding request packet is not parsed, and it is determined whether the authentication information of the next request packet passes, until the authentication information passes.

6. The method according to claim 1, characterized in that, The method further includes: When adding and / or deleting the user number information to be stored in the preset array, the corresponding change instruction is appended to the AOF file, and all the user number information to be stored is saved locally; When the user number information to be stored is lost, the data is recovered based on the AOF file.

7. The method according to claim 6, characterized in that, Before recovering data from the AOF file, the method further includes: After restarting, the file corresponding to the user number information to be stored, which is stored locally, is loaded, and the AOF file is loaded.

8. A computer device, characterized in that, The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the computer device performs the method as described in any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a computer device, implements the method as described in any one of claims 1-7.