CN115835147B - Method and device for processing information related to short messages - Google Patents
Method and device for processing information related to short messages Download PDFInfo
- Publication number
- CN115835147B CN115835147B CN202211478139.8A CN202211478139A CN115835147B CN 115835147 B CN115835147 B CN 115835147B CN 202211478139 A CN202211478139 A CN 202211478139A CN 115835147 B CN115835147 B CN 115835147B
- Authority
- CN
- China
- Prior art keywords
- service
- key value
- short message
- cache
- remote dictionary
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 61
- 238000012545 processing Methods 0.000 title claims abstract description 48
- 230000010365 information processing Effects 0.000 claims abstract description 36
- 238000004364 calculation method Methods 0.000 claims abstract description 21
- 238000003672 processing method Methods 0.000 claims abstract description 19
- 230000008569 process Effects 0.000 claims description 17
- 238000004590 computer program Methods 0.000 claims description 15
- 230000001360 synchronised effect Effects 0.000 claims 1
- 238000010586 diagram Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 7
- 238000004891 communication Methods 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
Landscapes
- Mobile Radio Communication Systems (AREA)
Abstract
The invention provides a method and a device for processing related information of a short message, relates to the technical field of short message data processing, and can be used in the financial field or other technical fields. The method comprises the steps of receiving a short message calling request sent by a terminal to a service interface, carrying out hash calculation on a mobile phone number and a service number corresponding to the service interface, taking the hash value as a key value, checking whether a prestored key value identical to the key value exists in a service self cache, and if so, returning a prompt message of sent short messages to the terminal. The apparatus performs the above method. The short message related information processing method and the device provided by the embodiment of the invention can reduce the short message processing pressure of the service interface, improve the stability of service operation and save the cost of short message issuing.
Description
Technical Field
The invention relates to the technical field of short message data processing, in particular to a method and a device for processing related information of a short message.
Background
With the development of the internet age, user registration is often the most basic function of some services. Along with the registration behavior of the user, the mobile phone number is often used as a content which needs to be filled in during registration, and meanwhile, the server can issue an authentication code message to the user according to the mobile phone number filled in by the user, so that the service necessarily needs to have the function of issuing a short message. At this time, the short message sending interface of the service may be maliciously called, which affects the running stability of the service itself and increases the short message cost of the company.
The service can also adopt a blacklist mode, the numbers appearing in the interface are added into the blacklist immediately after a certain number of requests, when the numbers in the blacklist are requested again, error codes are returned directly without any other processing, and a short message sending interface is not called, but the mode can influence the short message receiving and sending requirements of real users and influence the user experience.
Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the invention provides a method and a device for processing related information of a short message, which can at least partially solve the problems in the prior art.
In one aspect, the present invention provides a method for processing related information of a short message, including:
Receiving a short message calling request sent by a terminal to a service interface, carrying out hash calculation on a mobile phone number and a service number corresponding to the service interface, and taking a hash value as a key value;
Checking whether a prestored key value which is the same as the key value exists in a service self cache, and if so, returning a prompt message which is sent with a short message to the terminal;
The service self-cache is a part of memory opened up from the memory space of the application program and is used for storing data required in the service operation process.
Before the step of receiving the short message calling request sent by the terminal to the service interface, the short message related information processing method further comprises the following steps:
if the short message calling request sent by the terminal to the service interface is determined to be received for the first time, carrying out hash calculation on the mobile phone number and the service number corresponding to the service interface;
Taking the hash value as a key value, determining a life cycle corresponding to the key value, synchronizing the key value and the corresponding life cycle to a remote dictionary server, and taking the key value as a prestored key value respectively corresponding to a service self cache and a remote dictionary service cache;
Controlling the storage time length of the pre-stored key value in the service self cache and the remote dictionary service cache respectively according to the life cycle;
wherein the storage capacity of the service self cache is less than the storage capacity of the remote dictionary service cache.
The method for processing the related information of the short message further comprises the following steps:
if not, forwarding the key value to a remote dictionary server;
And if a first feedback result returned by the remote dictionary server is received, a prompt message which is sent by the short message is returned to the terminal, wherein the first feedback result indicates that the prestored key value which is the same as the key value exists in a remote dictionary service cache.
The method for processing the related information of the short message further comprises the following steps:
And if a second feedback result returned by the remote dictionary server is received, a short message is sent again to the terminal, the key value is determined to be the preset storage key value and the life cycle corresponding to the key value again, the preset storage key value is stored in a service self cache, and the second feedback result indicates that the pre-stored key value which is the same as the key value does not exist in the remote dictionary service cache.
The method for processing the related information of the short message further comprises the following steps:
And if the storage capacity of the service self cache is determined to be out of limit, deleting the pre-stored key value stored earliest in the service self cache.
The method for processing the related information of the short message further comprises the following steps:
and determining a short message calling request sent by the first receiving terminal to the service interface according to the inherent identifier of the terminal.
Wherein determining a life cycle corresponding to the key value comprises:
and setting a life cycle corresponding to the key value through a command for setting the expiration time of the remote dictionary service.
In one aspect, the present invention provides a device for processing related information of a short message, including:
The mobile phone comprises a computing unit, a service interface and a mobile phone number, wherein the computing unit is used for receiving a short message calling request sent by a terminal to the service interface, carrying out hash computation on the mobile phone number and a service number corresponding to the service interface, and taking a hash value as a key value;
a return unit, configured to check whether a prestored key value identical to the key value exists in a service self cache, and if so, return a prompt message that a short message has been sent to the terminal;
The service self-cache is a part of memory opened up from the memory space of the application program and is used for storing data required in the service operation process.
In yet another aspect, an embodiment of the present invention provides an electronic device comprising a processor, a memory, and a bus, wherein,
The processor and the memory complete communication with each other through the bus;
The memory stores program instructions executable by the processor, the processor invoking the program instructions capable of performing the method of:
Receiving a short message calling request sent by a terminal to a service interface, carrying out hash calculation on a mobile phone number and a service number corresponding to the service interface, and taking a hash value as a key value;
Checking whether a prestored key value which is the same as the key value exists in a service self cache, and if so, returning a prompt message which is sent with a short message to the terminal;
The service self-cache is a part of memory opened up from the memory space of the application program and is used for storing data required in the service operation process.
Embodiments of the present invention provide a non-transitory computer readable storage medium comprising:
the non-transitory computer readable storage medium stores computer instructions that cause the computer to perform the method of:
Receiving a short message calling request sent by a terminal to a service interface, carrying out hash calculation on a mobile phone number and a service number corresponding to the service interface, and taking a hash value as a key value;
Checking whether a prestored key value which is the same as the key value exists in a service self cache, and if so, returning a prompt message which is sent with a short message to the terminal;
The service self-cache is a part of memory opened up from the memory space of the application program and is used for storing data required in the service operation process.
The method and the device for processing the related information of the short message, provided by the embodiment of the invention, are used for receiving a short message calling request sent by a terminal to a service interface, carrying out hash calculation on a mobile phone number and a service number corresponding to the service interface, taking a hash value as a key value, carrying the mobile phone number by the short message calling request, checking whether a prestored key value which is the same as the key value exists in a service self cache, and returning a prompt message of the sent short message to the terminal if the prestored key value exists, wherein the service self cache is a part of memory opened up from a memory space of an application program and is used for storing data required in a service operation process, so that the short message processing pressure of the service interface can be reduced, the service operation stability is improved, and the cost of issuing the short message is saved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. In the drawings:
Fig. 1 is a flow chart of a method for processing related information of a short message according to an embodiment of the present invention.
Fig. 2 is a flow chart of a method for processing related information of a short message according to another embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a device for processing related information of a sms according to an embodiment of the present invention.
Fig. 4 is a schematic diagram of an entity structure of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings. The exemplary embodiments of the present application and their descriptions herein are for the purpose of explaining the present application, but are not to be construed as limiting the application. It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be arbitrarily combined with each other.
Redis (Remote Dictionary Server), a remote dictionary service, is an open-source log-type, key-Value database written in ANSI C language, supported by a network, and capable of being based on memory and persistent.
TTL (Time To Live), i.e., the life cycle. In Redis, TTL is set for data stored in Redis through EXPIRE command, so that automatic data deletion due to expiration is realized.
And the multi-level caching is to add the caching respectively by fully utilizing each link of request processing, so that the service performance is improved.
Fig. 1 is a flow chart of a method for processing related information of a short message according to an embodiment of the present invention, as shown in fig. 1, where the method for processing related information of a short message according to an embodiment of the present invention includes:
step S1, receiving a short message calling request sent by a terminal to a service interface, carrying out hash calculation on a mobile phone number and a service number corresponding to the service interface, and taking a hash value as a key value, wherein the short message calling request carries the mobile phone number.
Step S2, checking whether a prestored key value which is the same as the key value exists in a service self cache, and if so, returning a prompt message which is sent with a short message to the terminal;
The service self-cache is a part of memory opened up from the memory space of the application program and is used for storing data required in the service operation process.
In the step S1, the device receives a short message call request sent by the terminal to the service interface, performs hash calculation on the mobile phone number and the service number corresponding to the service interface, and uses the hash value as a key value, where the short message call request carries the mobile phone number. The apparatus may be a computer device performing the method, for example a server, in particular an application server. It should be noted that, the data acquisition and analysis according to the embodiments of the present invention are authorized by the user. As shown in fig. 2, the "short message interface service" in fig. 2 corresponds to a service interface, the service interface and the service self cache may be deployed in an application server, the dis cache service may be deployed in a remote dictionary server, and the application server and the remote dictionary server may implement network communication connection.
The terminal may be a mobile phone as in fig. 2, where the mobile phone sends a short message calling request to the service interface, and the short message calling request carries a mobile phone number of the mobile phone.
The service interfaces are provided with service numbers, and different service interfaces correspond to different service numbers, so that the service numbers can be understood to play a role in identifying the service interfaces.
The service number may be represented by a character string, and is not particularly limited.
The mobile phone number and the service number can be combined, the combination mode is not particularly limited, hash calculation is carried out on the numbers and the characters obtained by combination, a hash value is obtained, and the hash value is used as a key value of Redis.
Before the step of receiving the short message calling request sent by the terminal to the service interface, the short message related information processing method further comprises the following steps:
if the first receiving terminal determines the short message calling request sent to the service interface, hash calculation is performed on the mobile phone number and the service number corresponding to the service interface, and the step can refer to the description of the short message calling request sent to the service interface by the non-first receiving terminal and is not repeated.
The short message related information processing method further comprises the following steps:
And determining a short message calling request sent by the first receiving terminal to the service interface according to the inherent identifier of the terminal. The terminal-specific identity may include an IMEI code, as follows:
An international mobile equipment identification (International Mobile Equipment Identity, IMEI), known as a mobile phone serial number, a mobile phone "serial number", is used to identify each individual mobile communication device such as a mobile phone in a mobile phone network, and corresponds to an identification card of the mobile phone.
If the IMEI code is acquired for the first time, the short message calling request sent by the first receiving terminal to the service interface is indicated.
The method for determining the life cycle corresponding to the key value comprises the steps of taking the hash value as the key value, determining the life cycle corresponding to the key value, synchronizing the key value and the corresponding life cycle to a remote dictionary server, taking the key value as prestored key values respectively corresponding to a service self cache and a remote dictionary service cache, and determining the life cycle corresponding to the key value, wherein the method comprises the following steps:
and setting a life cycle corresponding to the key value through a command for setting the expiration time of the remote dictionary service. I.e., setting the TTL for the data deposited in the dis based on the EXPIRE command in the dis. The embodiment of the invention firstly determines the life cycle corresponding to the key value in the application program server, and then synchronizes the key value and the corresponding life cycle to the remote dictionary server through a network.
The application server takes the key value as a pre-stored key value and stores the key value in a local service self cache, and the remote dictionary server takes the key value as the pre-stored key value and stores the key value in the local remote dictionary service cache.
The life cycle can be set autonomously according to practical situations, for example, 5 minutes, and it can be understood that the storage duration of the prestored key values in the service self-cache and the remote dictionary service cache is 5 minutes, and exceeding the duration, the prestored key values can be automatically deleted from the service self-cache and the remote dictionary service cache respectively.
And controlling the storage time lengths of the pre-stored key values in the service self cache and the remote dictionary service cache respectively according to the life cycle, namely automatically deleting the pre-stored key value in the service self cache when the storage time length of the pre-stored key value in the service self cache reaches the life cycle, and automatically deleting the pre-stored key value in the remote dictionary service cache when the storage time length of the pre-stored key value in the remote dictionary service cache of the remote dictionary server reaches the life cycle.
Wherein the storage capacity of the service self cache is less than the storage capacity of the remote dictionary service cache. The short message related information processing method further comprises the following steps:
And if the storage capacity of the service self cache is determined to be out of limit, deleting the pre-stored key value stored earliest in the service self cache. Because the storage capacity of the service self-cache is smaller, if the concurrent quantity of the short message call requests is large in the corresponding time period of the life cycle, the storage capacity of the service self-cache is over-limited, so that the pre-stored key value stored earliest in the service self-cache can be deleted, for example, when the ith pre-stored key value is stored, the storage capacity of the service self-cache is full, and when the (i+1) th pre-stored key value needs to be stored, the pre-stored key value stored earliest in the service self-cache can be deleted.
At this point there is no pre-stored key stored earliest in the service's own cache, but there is also the pre-stored key stored earliest in the remote dictionary service cache.
In the step S2, the device checks whether the prestored key value identical to the key value exists in the service self cache, if so, the device returns a prompt message that the short message has been sent to the terminal;
the service self-cache is a part of memory opened up from the memory space of the application program and is used for storing data required in the service operation process. If the prestored key value which is the same as the key value exists in the service self cache, the storage time length of the prestored key value is not up to the life cycle, and the prestored key value exists in the service self cache (the storage capacity of the service self cache is not deleted because of overrun), so that a prompt message of the sent short message is directly returned to the terminal, namely the short message is not required to be sent, the short message cost is saved, and a remote dictionary server is not required to participate in data processing.
The short message related information processing method further comprises the following steps:
If the key value is not stored, the key value is forwarded to the remote dictionary server, the remote dictionary server receives the key value and compares the key value with a prestored key value in a remote dictionary service cache, if the comparison result is the same, the key value is indicated to be because the overrun of the storage capacity of the service cache is deleted, and a first feedback result is returned to the application program server.
And if a first feedback result returned by the remote dictionary server is received, a prompt message which is sent by the short message is returned to the terminal, wherein the first feedback result indicates that the prestored key value which is the same as the key value exists in a remote dictionary service cache. Reference is made to the above description and will not be repeated.
The short message related information processing method further comprises the following steps:
And if a second feedback result returned by the remote dictionary server is received, a short message is sent again to the terminal, the key value is determined to be the preset storage key value and the life cycle corresponding to the key value again, the preset storage key value is stored in a service self cache, and the second feedback result indicates that the pre-stored key value which is the same as the key value does not exist in the remote dictionary service cache. The remote dictionary server receives the key value, compares the key value with a prestored key value in a remote dictionary service cache, if the comparison result is different, the storage time of the key value exceeds the life cycle, the key value is automatically deleted, the key value needs to be redetermined to be a preset storage key value, the life cycle corresponding to the key value is determined, and the preset storage key value is stored in the service self cache.
It should be noted that, if the remote dictionary server determines that the same prestored key value as the key value does not exist in the remote dictionary service cache, it is also necessary to redetermine the key value to be the preset stored key value and the life cycle corresponding to the key value, and store the preset stored key value into the remote dictionary service cache.
The method for processing the related information of the short message, provided by the embodiment of the invention, receives a short message calling request sent by a terminal to a service interface, carries out hash calculation on a mobile phone number and a service number corresponding to the service interface, takes a hash value as a key value, the short message calling request carries the mobile phone number, checks whether a prestored key value which is the same as the key value exists in a service self cache, and returns a prompt message of sent short message to the terminal if the prestored key value exists, wherein the service self cache is a part of memory opened up from a memory space of an application program and is used for storing data required in a service operation process, the short message processing pressure of the service interface can be reduced, the service operation stability is improved, and the cost of short message issuing is saved.
Further, before the step of receiving the short message call request sent by the terminal to the service interface, the short message related information processing method further includes:
If it is determined that the first time of receiving the short message call request sent by the terminal to the service interface, hash calculation is performed on the mobile phone number and the service number corresponding to the service interface, and the description can be referred to without redundant description.
And taking the hash value as a key value, determining a life cycle corresponding to the key value, synchronizing the key value and the corresponding life cycle to a remote dictionary server, and taking the key value as a prestored key value respectively corresponding to a service self cache and a remote dictionary service cache, wherein the description can be referred to and is not repeated.
And controlling the storage time periods of the pre-stored key values in the service self cache and the remote dictionary service cache respectively according to the life cycle, wherein the description can be referred to and the redundant description is omitted.
Wherein the storage capacity of the service self cache is less than the storage capacity of the remote dictionary service cache. Reference is made to the above description and will not be repeated.
According to the short message related information processing method provided by the embodiment of the invention, the control of the short message related information is realized based on the secondary cache mechanism, so that the short message processing pressure of a service interface can be further reduced, the stability of service operation is improved, and the cost of short message issuing is saved.
Further, the method for processing the related information of the short message further comprises the following steps:
if not, the key value is forwarded to the remote dictionary server, and the description can be referred to without redundant description.
And if a first feedback result returned by the remote dictionary server is received, a prompt message which is sent by the short message is returned to the terminal, wherein the first feedback result indicates that the prestored key value which is the same as the key value exists in a remote dictionary service cache. Reference is made to the above description and will not be repeated.
According to the short message related information processing method provided by the embodiment of the invention, the application program server directly returns the prompt message of the sent short message to the terminal, so that the short message processing pressure of the service interface can be further reduced, the stability of service operation is improved, and the cost of sending the short message is saved.
Further, the method for processing the related information of the short message further comprises the following steps:
And if a second feedback result returned by the remote dictionary server is received, a short message is sent again to the terminal, the key value is determined to be the preset storage key value and the life cycle corresponding to the key value again, the preset storage key value is stored in a service self cache, and the second feedback result indicates that the pre-stored key value which is the same as the key value does not exist in the remote dictionary service cache. Reference is made to the above description and will not be repeated.
According to the short message related information processing method provided by the embodiment of the invention, the application server resends the short message and the like to the terminal, so that the short message processing pressure of the service interface can be further reduced, the stability of service operation is improved, and the cost of sending the short message is saved.
Further, the method for processing the related information of the short message further comprises the following steps:
and if the storage capacity of the service self cache is determined to be out of limit, deleting the pre-stored key value stored earliest in the service self cache. Reference is made to the above description and will not be repeated.
The short message related information processing method provided by the embodiment of the invention realizes the optimized storage of the pre-stored key value.
Further, the method for processing the related information of the short message further comprises the following steps:
and determining a short message calling request sent by the first receiving terminal to the service interface according to the inherent identifier of the terminal. Reference is made to the above description and will not be repeated.
The method for processing the related information of the short message can effectively determine the short message calling request sent by the first receiving terminal to the service interface.
Further, determining a life cycle corresponding to the key value includes:
and setting a life cycle corresponding to the key value through a command for setting the expiration time of the remote dictionary service. Reference is made to the above description and will not be repeated.
The short message related information processing method provided by the embodiment of the invention can conveniently determine the life cycle corresponding to the key value.
It should be noted that, the method for processing the related information of the short message provided by the embodiment of the invention can be used in the financial field and also can be used in any technical field except the financial field, and the application field of the method for processing the related information of the short message is not limited by the embodiment of the invention.
Fig. 3 is a schematic structural diagram of a short message related information processing apparatus according to an embodiment of the present invention, and as shown in fig. 3, the short message related information processing apparatus according to an embodiment of the present invention includes a calculating unit 301 and a returning unit 302, where:
The computing unit 301 is configured to receive a short message call request sent by a terminal to a service interface, perform hash computation on a mobile phone number and a service number corresponding to the service interface, and use the hash value as a key value, where the short message call request carries the mobile phone number, and the returning unit 302 is configured to check whether a prestored key value identical to the key value exists in a service self cache, and if so, return a prompt message that a short message has been sent to the terminal, where the service self cache is a part of memory opened up from a memory space of an application program, and is used for storing data required in a service running process.
Specifically, the computing unit 301 in the device is configured to receive a short message call request sent by a terminal to a service interface, perform hash computation on a mobile phone number and a service number corresponding to the service interface, and use the hash value as a key value, where the short message call request carries the mobile phone number, and the returning unit 302 is configured to check whether a prestored key value identical to the key value exists in a service self cache, and if so, return a prompt message that a short message has been sent to the terminal, where the service self cache is a portion of memory opened up from a memory space of an application program, and is used to store data required in a service running process.
The short message related information processing device provided by the embodiment of the invention receives a short message calling request sent by a terminal to a service interface, carries out hash calculation on a mobile phone number and a service number corresponding to the service interface, takes a hash value as a key value, the short message calling request carries the mobile phone number, checks whether a prestored key value which is the same as the key value exists in a service self cache, and returns a prompt message of sent short messages to the terminal if the prestored key value exists, wherein the service self cache is a part of memory opened up from a memory space of an application program and is used for storing data required in a service operation process, the short message processing pressure of the service interface can be reduced, the service operation stability is improved, and the cost of short message issuing is saved.
Further, before the step of receiving the short message call request sent by the terminal to the service interface, the short message related information processing device is further configured to:
if the short message calling request sent by the terminal to the service interface is determined to be received for the first time, carrying out hash calculation on the mobile phone number and the service number corresponding to the service interface;
Taking the hash value as a key value, determining a life cycle corresponding to the key value, synchronizing the key value and the corresponding life cycle to a remote dictionary server, and taking the key value as a prestored key value respectively corresponding to a service self cache and a remote dictionary service cache;
Controlling the storage time length of the pre-stored key value in the service self cache and the remote dictionary service cache respectively according to the life cycle;
wherein the storage capacity of the service self cache is less than the storage capacity of the remote dictionary service cache.
The short message related information processing device provided by the embodiment of the invention realizes the control of the short message related information based on the secondary cache mechanism, further can reduce the short message processing pressure of the service interface, improves the stability of service operation, and saves the cost of short message issuing.
Further, the short message related information processing device is further configured to:
if not, forwarding the key value to a remote dictionary server;
And if a first feedback result returned by the remote dictionary server is received, a prompt message which is sent by the short message is returned to the terminal, wherein the first feedback result indicates that the prestored key value which is the same as the key value exists in a remote dictionary service cache.
According to the short message related information processing device provided by the embodiment of the invention, the application program server directly returns the prompt message of the sent short message to the terminal, so that the short message processing pressure of the service interface can be further reduced, the stability of service operation is improved, and the cost of sending the short message is saved.
Further, the short message related information processing device is further configured to:
And if a second feedback result returned by the remote dictionary server is received, a short message is sent again to the terminal, the key value is determined to be the preset storage key value and the life cycle corresponding to the key value again, the preset storage key value is stored in a service self cache, and the second feedback result indicates that the pre-stored key value which is the same as the key value does not exist in the remote dictionary service cache.
According to the short message related information processing device provided by the embodiment of the invention, the application server resends the short message and the like to the terminal, so that the short message processing pressure of the service interface can be further reduced, the stability of service operation is improved, and the cost of sending the short message is saved.
Further, the short message related information processing device is further configured to:
And if the storage capacity of the service self cache is determined to be out of limit, deleting the pre-stored key value stored earliest in the service self cache.
The short message related information processing device provided by the embodiment of the invention realizes the optimized storage of the pre-stored key value.
Further, the short message related information processing device is further configured to:
and determining a short message calling request sent by the first receiving terminal to the service interface according to the inherent identifier of the terminal.
The short message related information processing device provided by the embodiment of the invention can effectively determine the short message calling request sent by the first receiving terminal to the service interface.
Further, the short message related information processing device is further configured to:
and setting a life cycle corresponding to the key value through a command for setting the expiration time of the remote dictionary service.
The short message related information processing device provided by the embodiment of the invention can conveniently determine the life cycle corresponding to the key value.
The embodiment of the present invention provides a processing flow of a short message related information processing apparatus, which may be specifically used to execute the above processing flow of each method embodiment, and the functions thereof are not described herein again, and may refer to the detailed description of the above method embodiments.
Fig. 4 is a schematic diagram of an entity structure of an electronic device according to an embodiment of the present invention, as shown in fig. 4, where the electronic device includes a processor (processor) 401, a memory (memory) 402, and a bus 403;
wherein, the processor 401 and the memory 402 complete the communication with each other through the bus 403;
The processor 401 is configured to call the program instructions in the memory 402 to perform the methods provided in the above method embodiments, for example, including:
Receiving a short message calling request sent by a terminal to a service interface, carrying out hash calculation on a mobile phone number and a service number corresponding to the service interface, and taking a hash value as a key value;
Checking whether a prestored key value which is the same as the key value exists in a service self cache, and if so, returning a prompt message which is sent with a short message to the terminal;
The service self-cache is a part of memory opened up from the memory space of the application program and is used for storing data required in the service operation process.
The present embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, are capable of performing the methods provided by the above-described method embodiments, for example comprising:
Receiving a short message calling request sent by a terminal to a service interface, carrying out hash calculation on a mobile phone number and a service number corresponding to the service interface, and taking a hash value as a key value;
Checking whether a prestored key value which is the same as the key value exists in a service self cache, and if so, returning a prompt message which is sent with a short message to the terminal;
The service self-cache is a part of memory opened up from the memory space of the application program and is used for storing data required in the service operation process.
The present embodiment provides a computer-readable storage medium storing a computer program that causes the computer to execute the methods provided by the above-described method embodiments, for example, including:
Receiving a short message calling request sent by a terminal to a service interface, carrying out hash calculation on a mobile phone number and a service number corresponding to the service interface, and taking a hash value as a key value;
Checking whether a prestored key value which is the same as the key value exists in a service self cache, and if so, returning a prompt message which is sent with a short message to the terminal;
The service self-cache is a part of memory opened up from the memory space of the application program and is used for storing data required in the service operation process.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In the description of the present specification, reference to the terms "one embodiment," "one particular embodiment," "some embodiments," "for example," "an example," "a particular example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The foregoing description of the embodiments has been provided for the purpose of illustrating the general principles of the invention, and is not meant to limit the scope of the invention, but to limit the invention to the particular embodiments, and any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the invention are intended to be included within the scope of the invention.
Claims (8)
1. The method for processing the related information of the short message is characterized by comprising the following steps:
if the short message calling request sent by the terminal to the service interface is determined to be received for the first time, carrying out hash calculation on the mobile phone number and the service number corresponding to the service interface;
Taking the hash value as a key value, determining a life cycle corresponding to the key value, synchronizing the key value and the corresponding life cycle to a remote dictionary server, and taking the key value as a prestored key value respectively corresponding to a service self cache and a remote dictionary service cache;
Controlling the storage time length of the pre-stored key value in the service self cache and the remote dictionary service cache respectively according to the life cycle;
Receiving a short message calling request sent by a terminal to a service interface, carrying out hash calculation on a mobile phone number and a service number corresponding to the service interface, and taking a hash value as a key value, wherein the short message calling request carries the mobile phone number;
checking whether a prestored key value which is the same as the key value exists in the self-caching of the service, and if so, returning a prompt message which is sent with a short message to the terminal;
if the key value does not exist, forwarding the key value to the remote dictionary server, comparing the key value with a prestored key value in a remote dictionary service cache by the remote dictionary server, and returning a feedback result according to a comparison result;
If a first feedback result returned by the remote dictionary server is received, a prompt message which is sent by a short message is returned to the terminal, wherein the first feedback result indicates that a prestored key value which is the same as the key value exists in the remote dictionary service cache;
the service self-cache is a part of memory opened up from the memory space of the application program and used for storing data required in the service operation process, and the storage capacity of the service self-cache is smaller than that of the remote dictionary service cache.
2. The short message related information processing method according to claim 1, characterized in that the short message related information processing method further comprises:
And if a second feedback result returned by the remote dictionary server is received, a short message is sent again to the terminal, the key value is determined to be the preset storage key value and the life cycle corresponding to the key value again, the preset storage key value is stored in a service self cache, and the second feedback result indicates that the pre-stored key value which is the same as the key value does not exist in the remote dictionary service cache.
3. The short message related information processing method according to claim 1, characterized in that the short message related information processing method further comprises:
And if the storage capacity of the service self cache is determined to be out of limit, deleting the pre-stored key value stored earliest in the service self cache.
4. The short message related information processing method according to claim 1, characterized in that the short message related information processing method further comprises:
and determining a short message calling request sent by the first receiving terminal to the service interface according to the inherent identifier of the terminal.
5. The method for processing short message related information according to claim 1, wherein determining a life cycle corresponding to the key value comprises:
and setting a life cycle corresponding to the key value through a command for setting the expiration time of the remote dictionary service.
6. A short message related information processing apparatus, characterized by comprising:
the mobile phone number and the service number corresponding to the service interface are subjected to hash calculation, the hash value is used as a key value, the life cycle corresponding to the key value is determined, the key value and the corresponding life cycle are synchronized to a remote dictionary server, the key value is respectively used as a pre-stored key value corresponding to a service self cache and a remote dictionary service cache, the storage time of the pre-stored key value in the service self cache and the remote dictionary service cache is controlled according to the life cycle, the mobile phone number and the service number corresponding to the service interface are subjected to hash calculation by the receiving terminal, the hash value is used as the key value, and the service number is used for identifying the service interface;
The remote dictionary server compares the key value with the prestored key value in the remote dictionary service cache and returns a feedback result according to the comparison result, if a first feedback result returned by the remote dictionary server is received, the prompt message of the sent short message is returned to the terminal, and the first feedback result indicates that the prestored key value identical to the key value exists in the remote dictionary service cache;
the service self-cache is a part of memory opened up from the memory space of the application program and used for storing data required in the service operation process, and the storage capacity of the service self-cache is smaller than that of the remote dictionary service cache.
7. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method of any one of claims 1 to 5 when the computer program is executed by the processor.
8. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 5.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211478139.8A CN115835147B (en) | 2022-11-23 | 2022-11-23 | Method and device for processing information related to short messages |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211478139.8A CN115835147B (en) | 2022-11-23 | 2022-11-23 | Method and device for processing information related to short messages |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN115835147A CN115835147A (en) | 2023-03-21 |
| CN115835147B true CN115835147B (en) | 2025-01-28 |
Family
ID=85530863
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211478139.8A Active CN115835147B (en) | 2022-11-23 | 2022-11-23 | Method and device for processing information related to short messages |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115835147B (en) |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102946596A (en) * | 2012-11-29 | 2013-02-27 | 广东全通教育股份有限公司 | Method and system for preventing resending of short message based on digital signature technology |
Family Cites Families (14)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8543091B2 (en) * | 2008-06-06 | 2013-09-24 | Ebay Inc. | Secure short message service (SMS) communications |
| US8504083B1 (en) * | 2011-06-24 | 2013-08-06 | Amazon Technologies, Inc. | Analysis of message service provider quality of service |
| US20160005035A1 (en) * | 2014-07-02 | 2016-01-07 | Mistral Mobile | Secure financial transaction using plain text sms |
| CN104113830A (en) * | 2014-07-29 | 2014-10-22 | 广东能龙教育股份有限公司 | A large-scale short message anti-retransmission method based on MD5 and distributed cache |
| CN105868231A (en) * | 2015-12-01 | 2016-08-17 | 乐视体育文化产业发展(北京)有限公司 | Cache data updating method and device |
| KR20170140570A (en) * | 2016-06-13 | 2017-12-21 | (주)삼위 | Method and System for Providing Remittance Transaction by using Short Message Service |
| CN106878280B (en) * | 2017-01-10 | 2020-07-24 | 阿里巴巴集团控股有限公司 | User authentication method and device, and method and device for acquiring user number information |
| CN111031498B (en) * | 2018-10-10 | 2023-04-07 | 中兴通讯股份有限公司 | Network system supporting 5G terminal short message service and construction method thereof |
| CN109447750B (en) * | 2018-10-24 | 2021-10-29 | 拉扎斯网络科技(上海)有限公司 | A server, order processing method and system |
| CN112347134B (en) * | 2020-11-05 | 2023-05-30 | 平安科技(深圳)有限公司 | Redis cache management method, device, computer equipment and storage medium |
| CN112965818B (en) * | 2021-02-26 | 2022-08-26 | 平安普惠企业管理有限公司 | Service cluster unitized grouping method, device, equipment and medium |
| CN113407363B (en) * | 2021-06-23 | 2024-05-17 | 京东科技控股股份有限公司 | Sliding window counting method and device based on remote dictionary service |
| CN113873449B (en) * | 2021-09-15 | 2022-09-20 | 北京仁科互动网络技术有限公司 | Short message sending method, cloud service system, electronic device and storage medium |
| CN114218267B (en) * | 2021-11-24 | 2024-12-20 | 建信金融科技有限责任公司 | Query request asynchronous processing method, device, computer equipment, and storage medium |
-
2022
- 2022-11-23 CN CN202211478139.8A patent/CN115835147B/en active Active
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102946596A (en) * | 2012-11-29 | 2013-02-27 | 广东全通教育股份有限公司 | Method and system for preventing resending of short message based on digital signature technology |
Also Published As
| Publication number | Publication date |
|---|---|
| CN115835147A (en) | 2023-03-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN108595207A (en) | A kind of gray scale dissemination method, regulation engine, system, terminal and storage medium | |
| CN110544097A (en) | Intelligent contract version control, calling and upgrading method, equipment and storage medium | |
| CN110673933A (en) | ZooKeeper-based distributed asynchronous queue implementation method, device, equipment and medium | |
| CN113760976B (en) | Service processing method, device, equipment and storage medium | |
| US8612635B2 (en) | Reusing system configuration information and metadata for related operations | |
| CN115866039A (en) | Message processing method and device, electronic equipment and storage medium | |
| CN112632375B (en) | Session information processing method, server and storage medium | |
| CN110287007A (en) | Data call response method, server and computer readable storage medium | |
| CN101087262A (en) | An instant communication processing method and system | |
| CN112800066A (en) | Index management method, related device and storage medium | |
| CN115835147B (en) | Method and device for processing information related to short messages | |
| CN116132528B (en) | Flight management message pushing method and device and electronic equipment | |
| CN113805957A (en) | Dynamic loading method and device for edge terminal program | |
| CN111045725B (en) | Control method and device of code management system and storage medium | |
| CN115220714A (en) | Application programming interface development method and device | |
| WO2024193352A1 (en) | Data processing method and apparatus, computer device, and readable storage medium | |
| CN117331596A (en) | Application upgrading method, device, equipment and storage medium | |
| CN116484359A (en) | Double-buffer right verification method and device, computer equipment and readable storage medium | |
| CN112671825B (en) | Kafka message processing method and system | |
| CN110087201B (en) | Information processing method, device and storage medium | |
| CN111401672B (en) | A legality verification method, equipment and system based on blockchain | |
| CN114611079A (en) | Mobile terminal login method, device, equipment and storage medium | |
| CN112383633B (en) | Session management method and system | |
| CN120123402A (en) | Connection keep-alive method, device, equipment, medium and program product | |
| CN120301948A (en) | An interactive method, platform, device and storage medium based on AI gateway and AIAgent |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |