WO2019095416A1 - Information pushing method and apparatus, and terminal device and storage medium - Google Patents

Information pushing method and apparatus, and terminal device and storage medium Download PDF

Info

Publication number
WO2019095416A1
WO2019095416A1 PCT/CN2017/112539 CN2017112539W WO2019095416A1 WO 2019095416 A1 WO2019095416 A1 WO 2019095416A1 CN 2017112539 W CN2017112539 W CN 2017112539W WO 2019095416 A1 WO2019095416 A1 WO 2019095416A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
user
link
short
target
Prior art date
Application number
PCT/CN2017/112539
Other languages
French (fr)
Chinese (zh)
Inventor
闫保行
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019095416A1 publication Critical patent/WO2019095416A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Definitions

  • the present application relates to the field of communications technologies, and in particular, to an information push method, apparatus, terminal device, and storage medium.
  • SMS Short Message
  • the information link is a long link
  • the information pushed is too long, which exceeds the maximum number of words of the short message, so that the information may be split into two pieces of information and sent to the user, which affects the user experience.
  • the amount of information sent is too large, which not only increases the transmission cost, but also may cause an overload problem, causing an abnormality in the server.
  • the embodiment of the present application provides an information push method, device, terminal device, and storage medium to solve the problem that the information sent may be too large when there is a long link in the currently transmitted information.
  • an embodiment of the present application provides an information pushing method, including:
  • the information generating instruction includes an information template ID and a user ID
  • to-be-push information based on the information template ID and the user ID, where the to-be-push information includes a long link and information content;
  • the target push information is sent to a client corresponding to the user ID.
  • an information pushing apparatus including:
  • An information generating instruction module configured to acquire an information generating instruction, where the information generating instruction includes an information template ID and User ID;
  • the to-be-push information acquisition module is configured to obtain information to be pushed based on the information template ID and the user ID, where the to-be-push information includes a long link and an information content;
  • a short link obtaining module configured to convert the long link by using a long chain to short chain algorithm to obtain a short link
  • a target push information obtaining module configured to acquire target push information based on the short link and the information content
  • the target push information sending module is configured to send the target push information to a client corresponding to the user ID.
  • an embodiment of the present application provides a terminal device, including a memory, a processor, and computer readable instructions stored in the memory and executable on the processor, where the processor executes the computer The following steps are implemented when reading the instruction:
  • the information generating instruction includes an information template ID and a user ID
  • to-be-push information based on the information template ID and the user ID, where the to-be-push information includes a long link and information content;
  • the target push information is sent to a client corresponding to the user ID.
  • an embodiment of the present application provides a computer readable storage medium, where the computer readable storage medium stores computer readable instructions, and when the computer readable instructions are executed by a processor, the following steps are implemented:
  • the information generating instruction includes an information template ID and a user ID
  • to-be-push information based on the information template ID and the user ID, where the to-be-push information includes a long link and information content;
  • the target push information is sent to a client corresponding to the user ID.
  • an information generating instruction is first acquired, where the information generating instruction includes an information template ID and a user ID, so as to acquire the user profile based on the information template ID and the user ID.
  • the information to be pushed includes information content and a long link.
  • the information template is retrieved according to the instruction generated by the information, and the process does not need manual editing, which saves time and makes the information pushing more efficient.
  • use the long-chain to short-chain algorithm to convert long links and get short links.
  • the target push information is sent to the client corresponding to the user ID.
  • the device, the terminal device, and the storage medium perform information push, the information is not required to be sent to the user because the link length is longer than the number of the short message limit word, which is beneficial to reducing the amount of information sent and saving the hair. Send the cost.
  • FIG. 1 is a flowchart of a method for pushing information provided in Embodiment 1 of the present application.
  • FIG. 2 is a specific schematic diagram of step S20 of FIG. 1.
  • FIG. 3 is a specific schematic diagram of step S30 of FIG. 1.
  • FIG. 4 is a flowchart of a method for pushing information provided in Embodiment 1 of the present application.
  • FIG. 5 is a flowchart of a method for pushing information provided in Embodiment 1 of the present application.
  • FIG. 6 is a flowchart of an information pushing method provided in Embodiment 1 of the present application.
  • FIG. 7 is a schematic block diagram of an information pushing apparatus provided in Embodiment 2 of the present application.
  • FIG. 8 is a schematic diagram of a terminal device provided in Embodiment 4 of the present application.
  • Fig. 1 is a flow chart showing a method of pushing information in the embodiment.
  • the information pushing method can be applied to a terminal device of a financial institution such as a bank, a securities, an insurance, or another institution, and can obtain customer resources by pushing information to a client such as a mobile phone corresponding to the client.
  • a client such as a mobile phone corresponding to the client.
  • the terminal device includes but is not limited to the server in this embodiment.
  • the information pushing method includes the following steps:
  • S10 Acquire an information generation instruction, where the information generation instruction includes an information template ID and a user ID.
  • the information generation instruction is an instruction for the terminal device to generate information.
  • the information template ID is an identifier for uniquely identifying the information template.
  • the user ID is an identifier for uniquely identifying the target user, and the user ID may be the mobile phone number of the target user.
  • the target user refers to the user corresponding to the information to be pushed. Specifically, sending different services to the target user
  • the information template needs to be developed for different service types, and the information template is stored in the server, and each information template corresponds to an information template ID.
  • S20 Acquire the information to be pushed based on the information template ID and the user ID, where the information to be pushed includes long links and information content.
  • the information to be pushed refers to information that has not been processed before the information is pushed.
  • the information to be pushed includes information content and at least one long link.
  • the long link refers to the webpage address of the service corresponding to the information to be pushed, such as the webpage address corresponding to different types of loans in the bank.
  • the information content refers to the information content of the information to be pushed for a specific service.
  • the long link and the information content in the to-be-pushed information may be obtained according to the information template ID and the user ID in the information generation instruction.
  • step S20 the information to be pushed is obtained based on the information template ID and the user ID, and the information to be pushed includes the long link and the information content, and specifically includes the following steps:
  • the information template refers to a template for generating information according to a corresponding service configuration, and the information template is pre-stored in a database and associated with a unique information template ID, so as to obtain a corresponding information template based on the template ID query.
  • the information template includes but is not limited to a user information module, a link module, and an information content module.
  • the user information module is associated with user information for populating different user information.
  • the link module is a module for storing a web page address of a corresponding service.
  • the information content module is a module for storing information content, that is, information content for a specific service.
  • the link module and the information content module in each information template match, that is, the long link in the link module can be linked to the webpage address related to the information content in the information content module. That is, the information content module in the information template is pre-filled with the information content, and the link module pre-populates the long link.
  • the database pre-stores information templates corresponding to different service types, and each information template corresponds to an information template ID, so that when the subsequent push information is sent to the target user, the information template ID in the information generation instruction is directly invoked accordingly.
  • Information templates save time and increase efficiency.
  • S22 Acquire user information corresponding to the user ID based on the user ID.
  • the user information corresponding to the user ID includes, but is not limited to, the user's name, gender, mobile phone number, ID number, and the like.
  • the user information is pre-stored in the database.
  • different user information may be separately retrieved from the database based on different user IDs, so that the user information is used to form the information to be pushed.
  • the user completes the registration on the application (ie, APP) on the mobile terminal such as the mobile phone or the tablet, so that the server corresponding to the application can obtain the corresponding user identifier (ie, the user ID).
  • the user ID ie, the user ID
  • the terminal After obtaining the information filled in by the user, the terminal uploads the user information to the server, so that the server stores the user information in a database such as MySQL and Oracle, and associates each user information with a user identifier (user ID). .
  • the user information acquisition process is simple and convenient.
  • S23 Acquire the information to be pushed based on the information template and the user information.
  • the information template obtained in step S21 carries the long link and the information content
  • the user information acquired in step S22 is filled in the user information module in the information template acquired in step S21, that is, the information template can be obtained.
  • the information is pushed such that the information to be pushed carries long links and information content. The process of obtaining the information to be pushed does not require manual intervention, saving time.
  • the long-chain to short-chain algorithm is an algorithm that converts long links into short links.
  • the short link is to convert the web address corresponding to the long link to obtain a shorter web address.
  • the long-chain to short-chain algorithm is used to convert the long link into a short link, so as to avoid that the character string of the long-term link is too long, and the character of the push information exceeds the limit, and the information is often split into two pieces and sent to the target. The phenomenon of the user appears, thereby saving the transmission cost and contributing to the improvement of the user experience.
  • step S30 a long-chain to short-chain algorithm is used to convert a long link to obtain a short link, which specifically includes the following steps:
  • the original byte string is a byte string obtained by splicing a long link with a preset key value.
  • the preset key value is a custom byte string including, but not limited to, an abbreviation of the user name or a lowercase full spell of the user name.
  • the splicing of the long link and the preset key value specifically refers to directly combining the long link with the preset key value, that is, adding the byte string corresponding to the long link and the byte string corresponding to the preset key value.
  • the original byte string is obtained, and the splicing method is simple and easy to implement.
  • S32 Encrypt the original byte string by using an information-digest algorithm to obtain a target byte string.
  • the message-digest algorithm (MD) algorithm is a function of changing an arbitrarily long input information string into a fixed-length output string, and is generally used for generating information digest, key encryption, and the like.
  • the fifth version of the MD algorithm that is, the MD5 algorithm
  • the MD5 has the characteristics of high security, so that user information is not easily leaked and user privacy is protected.
  • the target byte string refers to converting a raw byte string having no fixed length into a fixed length (128 bit binary) byte string, that is, a target byte string, by using an information-digest algorithm.
  • step S22 the original byte string is encrypted by using MD5 to obtain the target byte string, which specifically includes the following steps:
  • S325 Perform a four-round loop operation on the intermediate byte string to obtain a target byte string.
  • the number of loops is the number of 512-bit information packets in the message, N+1 times.
  • the operation of the four-round loop operation includes subdividing each 512 bits into 16 groups of 32 bits each; copying the above four link variables into the other four variables (a, b, c, d) , ie A to a, B to b, C to c, D to d.
  • the main loop has four rounds, and the operation of each round is very similar.
  • (( ⁇ x)&z); the second round of logical operation formula is G (x, y, z) (x&z)
  • the symbol & represents the AND operation
  • the symbol ⁇ represents the non-operation
  • the AND, NAND, and XOR operations are a basic logic operation in a computer.
  • M j represents the jth group of the 16 groups
  • ⁇ s represents the left shift of the s bit
  • ti represents the constant in the ith step, which is an integer of 2 32 *abs(sin(i))
  • the value of i is 1-64
  • the unit of i is radians.
  • the s value will be sequentially cycled according to the preset array s (the amount of displacement of the cyclic movement) in the order of the array until the end of each round of the loop. Understandably, the s array in each round is different.
  • s ⁇ 7,12,17,22 ⁇
  • s ⁇ 5,9,14,20 ⁇
  • s ⁇ 4,11,16,23 ⁇
  • s ⁇ 6,10,15,21 ⁇ . Because the security of the MD5 encryption algorithm is extremely high, the push information including the user information sent in this embodiment is more reliable, and it is not easy to disclose the user's personal information to ensure the personal interests of the user.
  • the target string refers to a string that converts the target byte string (128-bit binary) into hexadecimal. Since the processing of strings in the computer is generally processing hex strings, the target byte string (that is, the MD5 value of 128-bit binary) is converted into a hexadecimal string (that is, a 32-bit target character). string.
  • the process of converting the target byte string into the target string is as follows: a 16-byte (128-bit) target byte string is looped out and each byte taken is converted to obtain a hexadecimal character. Since each byte represents an 8-bit binary, it is necessary to first convert the upper four bits of each byte, then convert the lower four bits of each byte, and finally convert each byte. Character output to get the target string.
  • hexDigits[ ] (hexadecimal) is an algorithm that converts a string of bytes into a hexadecimal string.
  • the target byte string is converted into a hexadecimal target string, which can effectively avoid the garbled phenomenon of the target byte string acquired based on the MD5, thereby effectively improving the subsequent processing speed and improving efficiency.
  • the bitwise division of the target character string specifically refers to dividing the target character string (32-bit hexadecimal) obtained in step S32 into equal lengths, that is, dividing the target character string into groups of eight to obtain 4 groups of string groups, Each set of string groups contains eight hexadecimal numbers, which is easy to calculate.
  • S35 Perform bitwise AND operation on the eight-digit hexadecimal number and the first preset value in hexadecimal to obtain the first subscript value.
  • the first preset value is a custom hexadecimal number.
  • the first preset value is a hexadecimal number 0x3FFFFFFF
  • the four sets of eight-digit hexadecimal numbers obtained in step S34 are respectively bit-wise-operated with the first preset value, that is, 0x3FFFFFFF, because
  • the obtained operation result is the effective length of 32 bits. Therefore, it is necessary to select the lower 30 bits of the result of the operation, that is, remove the first two bits to obtain the first subscript value.
  • S36 Perform a bitwise AND operation on the first subscript value and the second preset value in hexadecimal to obtain a second subscript value.
  • the second preset value is a custom hexadecimal number. Further, the first subscript value obtained by step S35 and the second preset value are subjected to bitwise AND operation. In this embodiment, the second preset value is a hexadecimal number 0x0000003D, and the first subscript value and the 0x0000003D are bitwise ANDed to obtain a second subscript value.
  • the preset character array is a pre-defined character array containing characters for generating short links.
  • the preset character array includes but is not limited to uppercase English characters, lowercase English letters, and Arabic numerals (0 to 9).
  • the index of the preset character array is obtained by the second subscript value obtained in step S36. Based on the index of the preset character array, the characters corresponding to the second subscript value are cyclically selected from the preset character array, and the extracted characters are added each time, and then moved to the right by 5 bits to enter the next loop. , get candidate short links. Randomly pick a short link from the candidate links to get the short links you need.
  • the characters in the preset character array are taken out 6 times to obtain 6 characters, that is, a candidate short link is obtained, and since there are 4 loop operations in step S324, each loop is obtained.
  • a candidate short link will eventually get 4 candidate short links.
  • one candidate short link is randomly selected from the four candidate short links as the final short link.
  • the method used to obtain the index of the preset character array by using the second subscript value obtained in step S36 is an Index function.
  • the Index function returns a value in a table or region or a reference to a value.
  • the Index function has two forms: an array form and a reference form.
  • the array form usually returns a numeric value (in this embodiment, the index of the default character array is returned in numeric form) or an array of values; the reference form usually returns a reference.
  • the server determines whether the candidate short link is the same as the short link stored in the server, and if the candidate short link is the same as the short link stored by the server, the candidate can be directly rejected.
  • the short link in the candidate short links in which the remaining short links of the remaining servers are stored, a candidate short link is randomly selected as the final short link, and the process of selecting the short link can effectively avoid the problem of repetition, so that the pushed information has Uniqueness and pertinence.
  • S40 Acquire target push information based on short links and information content.
  • the short link is the short link corresponding to the long link in the information to be pushed acquired in step S30
  • the information content is the information content for the specific service in the information template acquired in step S20, and the information content is filled into the information template.
  • the short link is filled into the link module in the information template, that is, the target push information is acquired, and the target push information is stored in the cache server.
  • the cache server stores the target push information by using a buffer storage method including but not limited to the embodiment.
  • Buffer storage is a technology that increases the speed of content access by storing network content that needs frequent access in a system that is closer to the user and faster to access.
  • a cache server is a server that stores frequently accessed content, enabling users to access information faster and improve the user experience.
  • S50 Send the target push information to the client corresponding to the user ID.
  • the client (client) or client refers to a terminal that corresponds to the server and provides local services to the client.
  • the user ID includes but is not limited to the mobile phone number of the target user, and correspondingly, the client corresponding to the user ID is the mobile phone. That is, in step S50, the server sends the target push information acquired in step S40 to the client (ie, the mobile phone) of the user according to the mobile phone number of the user, so that the client displays the target push information.
  • the manner in which the server sends the target push information to the client includes, but is not limited to, a timed transmission method, which can be sent at a fixed time on a fixed date of the week, and reads the transmission time and marks the transmission time. Use the Date method to read the send time to return the date and time of the day. Understandably, each time a server sends a target push message, its sending time is marked, so that the target push information is time-series.
  • the information generation instruction is obtained, where the information generation instruction includes an information template ID and a user ID, so as to acquire information to be pushed corresponding to the user based on the information template ID and the user ID, where the information to be pushed includes information content and Long link.
  • the information template is retrieved according to the instruction generated by the information, and the process does not need manual editing, which saves time and makes the information pushing more efficient.
  • the target push information is periodically sent to the client corresponding to the user ID and the transmission time is acquired, so that the target push information is more sequential.
  • the information push method is used for information push, it is avoided that the information is segmented and sent to the user because the link length is longer than the number of the short message limit word, which is beneficial to reducing the amount of information sent and saving the transmission cost.
  • the information pushing method further includes the following steps:
  • S61 Acquire response information sent by the client.
  • the server when the server sends the target push information to the client corresponding to the user ID, the client automatically sends the response information to the server when receiving the target push information, so that the server knows whether the client receives the letter. Information, and based on the response information to determine whether the target push information needs to be resent to the client.
  • the server reads the current system time and records when receiving the response information, so that the response information sent by the server includes the current system time.
  • S62 Determine whether the current response time of the received response information exceeds a preset response time.
  • the preset response time is the response time originally set by the system.
  • the current response time is the difference between the system time acquired when the server receives the response information and the system time (ie, the transmission time) for transmitting the target push information, that is, the system time acquired in step S61 and the server sending target push acquired in step S40.
  • the difference in the current time read by the message.
  • the server when the server sends the target push information to the client corresponding to the user ID row, the server caches the sent target push information in the server, and records the system time (ie, the sending time) of transmitting the target push information.
  • the system time ie, the sending time
  • the target push information of the server buffer storage is directly sent to the client, saving time and improving efficiency.
  • the method further includes the step of: marking the short link so that the short link carries the short-chain identifier.
  • the short link acquired in step S30 is marked, so that the short link has a mapping relationship with the corresponding long link, and the short link carrying the short chain identifier is associated with the corresponding long link and stored in the database, and is created in the database.
  • a link information table in which a short link, a long link, a short chain identifier, and a long link content having a mapping relationship are stored, so that the database can be quickly and easily searched according to the short link to obtain a corresponding long link based on the link information table.
  • the long link content includes, but is not limited to, webpage content of a service type corresponding to the long link.
  • the information pushing method further includes a step S70: sending the webpage content corresponding to the target pushing information to the client.
  • step S70 specifically includes the following steps:
  • S71 Receive an access request sent by the client, where the access request includes a short-chain identifier.
  • the client displays the target push information sent by the server, and the target push information includes a short link and the information content.
  • the short link may be clicked to view the information.
  • the client receives the access request input by the short link clicked by the user, and sends the access request to the server, so that the server obtains the access request sent by the client.
  • the access request includes a short chain identifier to find a corresponding long link based on the short chain identifier.
  • S72 Search for the corresponding long link based on the short-chain identifier, and obtain the content of the webpage corresponding to the long link.
  • the server searches for the corresponding long link in the database according to the short-chain identifier carried by the short link.
  • the database stores therein a link information table including, but not limited to, a long link, a short link, a short chain identifier, and web content corresponding to the long link (ie, long link content). It can be understood that the short link identifier is used to find the corresponding long link, and then the corresponding web page content is found according to the long link. The process does not need to convert the short link into a long link through the conversion method, and only needs to find the corresponding directly through the short chain identifier. Long links save time and improve user experience.
  • S73 Send the webpage content to the client.
  • the webpage content refers to webpage content corresponding to the long link.
  • the server can find the corresponding long link in the database based on the short-chain identifier, and then find the corresponding webpage content according to the long link and send it to the client.
  • the server pre-associates the webpage content corresponding to the long link associated with the short-chain identifier, so that it is more convenient to find the corresponding webpage content through the long link.
  • the server receives the access request sent by the client, and returns the web content of the long link corresponding to the short link to the client, and the client receives the webpage content sent by the server and displays it on the client.
  • the content of the webpage is specifically H5 (Hypertext Markup Language, referred to as HTML5) interface, which is convenient for users to view.
  • Hypertext Markup Language is an application under the standard universal markup language. "Hypertext” means that the page can contain images, links, and even non-text elements such as music and programs.
  • the structure of the hypertext markup language includes a "header” portion, and a "body” portion, wherein the "header” portion provides information about the web page (ie, the title, preamble, description, etc. of the web page).
  • the "subject” portion provides the specific content of the web page.
  • the information pushing method further includes the following steps:
  • S81 The current cache time and the current cache number of the target push information cached by the statistics server.
  • the current cache time of the target push information refers to the time when the server caches the target push information that has been sent, which is specifically the difference between the system time of the server and the sending of the target push time (ie, the sending time).
  • the current number of caches is the amount of all sent target push information currently cached by the server.
  • the terminal device has a script for collecting the current cache time and the current cache number, and setting the script to run periodically to automatically count the current cache time and the current cache number, so that the process does not require manual intervention and improves work efficiency. .
  • the server also determines whether the current cache time exceeds a preset cache time.
  • the preset cache time is a preset cache time of the system.
  • the server records the sending time of the target push information every time a target push information is sent, and then determines the current cache time according to the system time of the server and the sending time, and then determines whether the current cache time exceeds the preset cache time. If the pre-defined reservation cache time is 3 months and the current cache time of the target push information is 2 months, the preset cache time is not exceeded.
  • the current cache time exceeds the preset cache time as a judgment condition for deleting the target push information of the cache, so as to reduce the number of caches and avoid caching. The amount is too large, causing the server to be abnormal.
  • the server also determines whether the current number of caches exceeds a preset number of caches.
  • the preset cache amount refers to the number of caches preset by the system.
  • the current cache count refers to the amount of all sent target push information currently cached by the server.
  • the current cache number exceeds the preset cache number as another judgment condition for deleting the target push information of the cache, which can effectively avoid the problem that the server crashes due to the overload of the cache number.
  • step S82 There are three cases in which the target push information is deleted in step S82. First, if the current cache time exceeds the preset cache time and the current cache number exceeds the preset cache number, the target push information is deleted. Second, if the current cache time does not exceed the preset cache time and the current cache number exceeds the preset cache number, the target push information is deleted. Third, if the current cache time exceeds the preset cache time but the current cache number does not exceed the preset cache number, the target push information is deleted.
  • the current cache time is A
  • the preset cache time B the current cache number is C
  • the target push information is deleted to save the storage space of the server.
  • the information generation instruction is obtained, where the information generation instruction includes an information template ID and a user ID, so as to acquire information to be pushed corresponding to the user based on the information template ID and the user ID, where the information to be pushed includes information content and Long link.
  • the information template is retrieved according to the information generation instruction, and the process does not need manual editing, which saves time and makes the information push more efficient. Then use the long-chain to short-chain algorithm to convert the long link and obtain the short link.
  • the target push information sent by the server is avoided, the information needs to be sent to the user segmentally because the link is too long. Quantity, saving on sending costs and improving user experience.
  • the target push information is sent to the client corresponding to the user ID, and the current cache time and the current cache number are obtained, and the current cache time and the current cache number are compared with the preset cache time and the preset cache number respectively, based on The comparison result deletes the useless target push information, so as to save the storage space of the server and reduce the load of the server, thereby effectively avoiding the server crash caused by the server overload and improving the performance of the server.
  • Fig. 7 is a block diagram showing the principle of the information pushing apparatus corresponding to the information pushing method in the first embodiment.
  • the information pushing apparatus includes an information generating instruction module 10, a to-be-pushed information acquiring module 20, a short link acquiring module 30, a target pushing information acquiring module 40, a target pushing information transmitting module 50, a short link labeling module 90, and Web content sending module 70.
  • the information generation instruction module 10 the to-be-pushed information acquisition module 20, the short link acquisition module 30, the target push information acquisition module 40, the target push information sending module 50, the short link labeling module 90, and the webpage content sending module 70.
  • the implementation functions are in one-to-one correspondence with the steps corresponding to the information pushing method in the embodiment. To avoid redundancy, the present embodiment is not described in detail.
  • the information generation instruction module 10 is configured to acquire an information generation instruction, where the information generation instruction includes an information template ID and a user ID.
  • the to-be-push information acquiring module 20 is configured to obtain the to-be-pushed information based on the information template ID and the user ID, and the to-be-pushed information includes a long link and an information content.
  • the short link obtaining module 30 is configured to convert the long link by using a long chain to short chain algorithm to obtain a short link.
  • the target push information obtaining module 40 is configured to acquire target push information based on the short link and the information content.
  • the target push information sending module 50 is configured to send the target push information to the client corresponding to the user ID.
  • Short link labeling module 90 for labeling short links so that short links carry short chain identifiers
  • the webpage content sending module 70 is configured to send the webpage content corresponding to the target push information to the client.
  • the to-be-pushed information acquisition module 20 includes an information template acquisition unit 21, a user information acquisition unit 22, and a to-be-pushed information acquisition unit 23.
  • the information template obtaining unit 21 is configured to acquire an information template based on the information template ID.
  • the user information obtaining unit 22 is configured to acquire the user information corresponding to the user ID based on the user ID based on the information template ID.
  • the to-be-push information acquiring unit 23 is configured to obtain information to be pushed based on the information template and the user information.
  • the short link acquisition module 30 includes a raw byte string acquisition unit 31, a target byte string acquisition unit 32, a target character string acquisition unit 33, an eight-digit hexadecimal number acquisition unit 34, and a first subscript value acquisition unit. 35.
  • the original byte string obtaining unit 31 is configured to splicing the long link with the preset key value to obtain the original byte string.
  • the target byte string obtaining unit 32 is configured to perform encryption processing on the original byte string by using an information-digest algorithm to obtain a target byte string.
  • the target string obtaining unit 33 is configured to perform character conversion on the target byte string to obtain a target character string.
  • the eight-digit hexadecimal number obtaining unit 34 is configured to bit-divide the target character string to obtain an eight-digit hexadecimal number.
  • the first subscript value obtaining unit 35 is configured to perform bitwise AND operation on the eight-digit hexadecimal number and the first preset value in hexadecimal to obtain the first subscript value.
  • the second subscript value obtaining unit 36 is configured to perform a bitwise AND operation on the first subscript value and the second preset value in hexadecimal to obtain a second subscript value.
  • the short link obtaining unit 37 is configured to obtain a character corresponding to the second subscript value from the character array to form a short link.
  • the webpage content transmitting module 70 includes an access request accepting unit 71, a webpage content obtaining unit 72, and a webpage content transmitting unit 73.
  • the access request receiving unit 71 is configured to receive an access request sent by the client, where the access request includes a short-chain identifier.
  • the webpage content obtaining unit 72 is configured to search for a corresponding long link based on the short-chain identifier, and obtain webpage content corresponding to the long link.
  • the webpage content sending unit 73 is configured to search for a corresponding long link based on the short-chain identifier, and obtain webpage content corresponding to the long-link.
  • the information pushing apparatus further includes a response information acquiring unit 61, a response time judging unit 62, and a target information resending unit 63.
  • the response information obtaining unit 61 is configured to obtain response information sent by the client.
  • the response time judging unit 62 judges whether or not the current response time of the reception response information exceeds the preset response time.
  • the target information resending unit 63 is configured to resend the target push information to the client corresponding to the user ID, for the current response time exceeding the preset response time.
  • the information pushing device further includes a statistic unit 81 and a target push information processing unit 82.
  • the statistic unit 81 is configured to count the current cache time and the current cache number of the target push information cached by the server.
  • the target push information processing unit 82 is configured to delete the target push information when the current cache time exceeds the preset cache time, and/or the current cache number exceeds the preset cache amount.
  • the embodiment provides a computer readable storage medium.
  • the computer readable storage medium stores computer readable instructions.
  • the information pushing method in Embodiment 1 is implemented. Let me repeat.
  • the functions of the modules/units of the information pushing apparatus in Embodiment 2 are implemented when the computer readable instructions are executed by the processor. To avoid repetition, details are not described herein again.
  • FIG. 8 is a schematic diagram of a terminal device according to an embodiment of the present application.
  • the terminal device 100 of this embodiment includes a processor 101, a memory 102, and computer readable instructions 103 stored in the memory 102 and executable on the processor 101.
  • the processor 101 executes the computer readable instructions 103, the steps in the above embodiments of the various information pushing methods are implemented, such as steps S10 to S50 shown in FIG.
  • the processor 101 implements the functions of the modules/units of the information pushing apparatus in the second embodiment described above when the computer readable instructions 103 are executed.
  • computer readable instructions 103 may be partitioned into one or more modules/units, one or more modules/units being stored in memory 102 and executed by processor 101 to complete the application.
  • the one or more modules/units may be a series of computer readable instruction segments capable of performing a particular function for describing the execution of computer readable instructions 103 in the terminal device 100.
  • the computer readable instruction 103 may be divided into an information generation instruction module 10, a to-be-pushed information acquisition module 20, a short link acquisition module 30, a target push information acquisition module 40, and a target push information transmission module 50, as shown in FIG.
  • the short link labeling module 90 and the webpage content sending module 70, the specific functions of each module are as described in the second embodiment, and are not described herein.
  • the terminal device 100 can be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the terminal device may include, but is not limited to, the processor 101 and the memory 102. It will be understood by those skilled in the art that FIG. 8 is only an example of the terminal device 100, and does not constitute a limitation of the terminal device 100, and may include more or less components than those illustrated, or combine some components or different components.
  • the terminal device may further include an input/output device, a network access device, a bus, and the like.
  • the processor 101 may be a central processing unit (CPU), or may be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the memory 102 may be an internal storage unit of the terminal device 100, such as a hard disk or a memory of the terminal device 100.
  • the memory 102 may also be an external storage device of the terminal device 100, such as a plug-in hard disk equipped on the terminal device 100, a smart memory card (SMC), a Secure Digital (SD) card, and a flash memory card (Flash). Card) and so on.
  • the memory 102 may also include both an internal storage unit of the terminal device 100 and an external storage device.
  • the memory 102 is used to store computer readable instructions as well as other programs and data required by the terminal device.
  • the memory 102 can also be used to temporarily store data that has been or will be output.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated modules/units if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium.
  • the present application implements all or part of the processes in the foregoing embodiments, and may also be implemented by computer readable instructions, which may be stored in a computer readable storage medium.
  • the computer readable instructions when executed by a processor, may implement the steps of the various method embodiments described above.
  • the computer readable instructions comprise computer readable instruction code, which may be in the form of source code, an object code form, an executable file or some intermediate form or the like.
  • the computer readable medium can include any entity or device capable of carrying the computer readable instruction code, a recording medium, a USB flash drive, a removable hard drive, a magnetic disk, an optical disk, a computer memory, a read only memory (ROM, Read-Only) Memory), random access memory (RAM), electrical carrier signals, telecommunications signals, and software distribution media.
  • a recording medium a USB flash drive
  • a removable hard drive a magnetic disk, an optical disk
  • a computer memory a read only memory (ROM, Read-Only) Memory
  • RAM random access memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

Disclosed are an information pushing method and apparatus, and a terminal device and a storage medium. The information pushing method comprises: acquiring an information generation instruction, wherein the information generation instruction comprises an information template ID and a user ID; acquiring, based on the information template ID and the user ID, information to be pushed, wherein the information to be pushed comprises a long link and information content; using a long link-to-short link algorithm to convert the long link so as to acquire a short link; acquiring target push information based on the short link and the information content; and sending the target push information to a client corresponding to the user ID. The information pushing method solves the problem of the current poor user experience of acquiring a customer resource by means of pushing information, enhances the user experience and saves on sending costs.

Description

信息推送方法、装置、终端设备及存储介质Information push method, device, terminal device and storage medium
本专利申请以2017年11月16日提交的申请号为201711134066.X,名称为“信息推送方法、装置、终端设备及存储介质”的中国发明专利申请为基础,并要求其优先权。This patent application is based on the Chinese Patent Application No. 201711134066.X filed on November 16, 2017, entitled "Information Pushing Method, Apparatus, Terminal Equipment and Storage Medium", and requires priority.
技术领域Technical field
本申请涉及通信技术领域,尤其涉及一种信息推送方法、装置、终端设备及存储介质。The present application relates to the field of communications technologies, and in particular, to an information push method, apparatus, terminal device, and storage medium.
背景技术Background technique
随着信息时代的发展,在银行、证券、保险等金融机构或者其他服务机构中,大都采用短信推送信息的方式获取客户资源(简称短信获客),其中推送的信息包括信息内容和信息链接。对于短信获客这种方式来说,若信息链接为长链接时,会导致推送的信息过长,超过短信的最大字数,使得信息可能会拆分成两条信息发送给用户,影响用户体验。并且,将一条信息拆分成两个信息发送时,会导致信息发送量过大,不仅增加发送成本,而且可能出现过载问题,导致服务器产生异常。With the development of the information age, most of the financial institutions such as banks, securities, insurance, and other service organizations use SMS to push information to obtain customer resources (referred to as SMS recipients), and the information pushed includes information content and information links. For the method of receiving a short message, if the information link is a long link, the information pushed is too long, which exceeds the maximum number of words of the short message, so that the information may be split into two pieces of information and sent to the user, which affects the user experience. Moreover, when a piece of information is split into two pieces of information, the amount of information sent is too large, which not only increases the transmission cost, but also may cause an overload problem, causing an abnormality in the server.
发明内容Summary of the invention
本申请实施例供一种信息推送方法、装置、终端设备及存储介质,以解决当前发送的信息存在长链接时可能导致信息发送量过大的问题。The embodiment of the present application provides an information push method, device, terminal device, and storage medium to solve the problem that the information sent may be too large when there is a long link in the currently transmitted information.
第一方面,本申请实施例提供一种信息推送方法,包括:In a first aspect, an embodiment of the present application provides an information pushing method, including:
获取信息生成指令,所述信息生成指令包括信息模板ID和用户ID;Obtaining an information generating instruction, where the information generating instruction includes an information template ID and a user ID;
基于所述信息模板ID和所述用户ID,获取待推送信息,所述待推送信息包括长链接和信息内容;Obtaining to-be-push information based on the information template ID and the user ID, where the to-be-push information includes a long link and information content;
采用长链转短链算法对所述长链接进行转化,获取短链接;Converting the long link by using a long chain to short chain algorithm to obtain a short link;
基于所述短链接和所述信息内容,获取目标推送信息;Obtaining target push information based on the short link and the information content;
将所述目标推送信息发送给与所述用户ID相对应的客户端。The target push information is sent to a client corresponding to the user ID.
第二方面,本申请实施例提供一种信息推送装置,包括:In a second aspect, an embodiment of the present application provides an information pushing apparatus, including:
信息生成指令模块,用于获取信息生成指令,所述信息生成指令包括信息模板ID和 用户ID;An information generating instruction module, configured to acquire an information generating instruction, where the information generating instruction includes an information template ID and User ID;
待推送信息获取模块,用于基于所述信息模板ID和所述用户ID,获取待推送信息,所述待推送信息包括长链接和信息内容;The to-be-push information acquisition module is configured to obtain information to be pushed based on the information template ID and the user ID, where the to-be-push information includes a long link and an information content;
短链接获取模块,用于采用长链转短链算法对所述长链接进行转化,获取短链接;a short link obtaining module, configured to convert the long link by using a long chain to short chain algorithm to obtain a short link;
目标推送信息获取模块,用于基于所述短链接和所述信息内容,获取目标推送信息;a target push information obtaining module, configured to acquire target push information based on the short link and the information content;
目标推送信息发送模块,用于将所述目标推送信息发送给与所述用户ID相对应的客户端。The target push information sending module is configured to send the target push information to a client corresponding to the user ID.
第三方面,本申请实施例提供一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and computer readable instructions stored in the memory and executable on the processor, where the processor executes the computer The following steps are implemented when reading the instruction:
获取信息生成指令,所述信息生成指令包括信息模板ID和用户ID;Obtaining an information generating instruction, where the information generating instruction includes an information template ID and a user ID;
基于所述信息模板ID和所述用户ID,获取待推送信息,所述待推送信息包括长链接和信息内容;Obtaining to-be-push information based on the information template ID and the user ID, where the to-be-push information includes a long link and information content;
采用长链转短链算法对所述长链接进行转化,获取短链接;Converting the long link by using a long chain to short chain algorithm to obtain a short link;
基于所述短链接和所述信息内容,获取目标推送信息;Obtaining target push information based on the short link and the information content;
将所述目标推送信息发送给与所述用户ID相对应的客户端。The target push information is sent to a client corresponding to the user ID.
第四方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,所述计算机可读指令被处理器执行时实现如下步骤:In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, where the computer readable storage medium stores computer readable instructions, and when the computer readable instructions are executed by a processor, the following steps are implemented:
获取信息生成指令,所述信息生成指令包括信息模板ID和用户ID;Obtaining an information generating instruction, where the information generating instruction includes an information template ID and a user ID;
基于所述信息模板ID和所述用户ID,获取待推送信息,所述待推送信息包括长链接和信息内容;Obtaining to-be-push information based on the information template ID and the user ID, where the to-be-push information includes a long link and information content;
采用长链转短链算法对所述长链接进行转化,获取短链接;Converting the long link by using a long chain to short chain algorithm to obtain a short link;
基于所述短链接和所述信息内容,获取目标推送信息;Obtaining target push information based on the short link and the information content;
将所述目标推送信息发送给与所述用户ID相对应的客户端。The target push information is sent to a client corresponding to the user ID.
本申请实施例提供的信息推送方法、装置、终端设备及存储介质中,先获取信息生成指令,该信息生成指令包括信息模板ID和用户ID,以便基于信息模板ID和用户ID,获取与用户相对应的待推送信息,该待推送信息包括信息内容和长链接。根据信息生成的指令调取信息模板,该过程无需人工编辑,节省时间,使得信息推送的效率更高。接着采用长链转短链算法对长链接进行转化,获取短链接。最后,将目标推送信息发送给与用户ID相对应的客户端。该信息推送方法、装置、终端设备及存储介质进行信息推送时,避免因链接过长超过短信限制字数而需将信息分段发送给用户,有利于降低信息发送量,节省发 送成本。In the information pushing method, device, terminal device and storage medium provided by the embodiment of the present application, an information generating instruction is first acquired, where the information generating instruction includes an information template ID and a user ID, so as to acquire the user profile based on the information template ID and the user ID. Corresponding to push information, the information to be pushed includes information content and a long link. The information template is retrieved according to the instruction generated by the information, and the process does not need manual editing, which saves time and makes the information pushing more efficient. Then use the long-chain to short-chain algorithm to convert long links and get short links. Finally, the target push information is sent to the client corresponding to the user ID. When the information push method, the device, the terminal device, and the storage medium perform information push, the information is not required to be sent to the user because the link length is longer than the number of the short message limit word, which is beneficial to reducing the amount of information sent and saving the hair. Send the cost.
附图说明DRAWINGS
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present application. Other drawings may also be obtained from those of ordinary skill in the art based on these drawings without the inventive labor.
图1是本申请实施例1中提供的信息推送方法的一流程图。FIG. 1 is a flowchart of a method for pushing information provided in Embodiment 1 of the present application.
图2是图1中步骤S20的一具体示意图。FIG. 2 is a specific schematic diagram of step S20 of FIG. 1.
图3是图1中步骤S30的一具体示意图。FIG. 3 is a specific schematic diagram of step S30 of FIG. 1.
图4是本申请实施例1中提供的信息推送方法的一流程图。FIG. 4 is a flowchart of a method for pushing information provided in Embodiment 1 of the present application.
图5是本申请实施例1中提供的信息推送方法的一流程图。FIG. 5 is a flowchart of a method for pushing information provided in Embodiment 1 of the present application.
图6是本申请实施例1中提供的信息推送方法的一流程图。FIG. 6 is a flowchart of an information pushing method provided in Embodiment 1 of the present application.
图7是本申请实施例2中提供的信息推送装置的原理框图。FIG. 7 is a schematic block diagram of an information pushing apparatus provided in Embodiment 2 of the present application.
图8是本申请实施例4中提供的终端设备的一示意图。FIG. 8 is a schematic diagram of a terminal device provided in Embodiment 4 of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the drawings in the embodiments of the present application. It is obvious that the described embodiments are a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
实施例1Example 1
图1示出本实施例中信息推送方法的流程图。该信息推送方法可应用在银行、证券、保险等金融机构或者其他机构的终端设备中,通过向客户对应的手机等客户端推送信息,以获取客户资源。采用该信息推送方法向客户端推送信息,可有效避免信息发送量过大所存在的问题,更好的提升用户体验度。可以理解地,该终端设备包括但不限于本实施例中的服务器。如图1所示,该信息推送方法包括如下步骤:Fig. 1 is a flow chart showing a method of pushing information in the embodiment. The information pushing method can be applied to a terminal device of a financial institution such as a bank, a securities, an insurance, or another institution, and can obtain customer resources by pushing information to a client such as a mobile phone corresponding to the client. By using the information push method to push information to the client, the problem of excessive information transmission can be effectively avoided, and the user experience is better improved. It can be understood that the terminal device includes but is not limited to the server in this embodiment. As shown in FIG. 1, the information pushing method includes the following steps:
S10:获取信息生成指令,信息生成指令包括信息模板ID和用户ID。S10: Acquire an information generation instruction, where the information generation instruction includes an information template ID and a user ID.
其中,信息生成指令是用于终端设备生成信息的指令。信息模板ID是用于唯一识别信息模板的标识。用户ID是用于唯一识别目标用户的标识,该用户ID可以为目标用户的手机号。该目标用户是指待推送信息所对应的用户。具体地,在给目标用户发送不同业务 的信息时,需要针对不同的业务类型制定不同的信息模板,并将信息模板存储在服务器中,每一信息模板对应一信息模板ID。The information generation instruction is an instruction for the terminal device to generate information. The information template ID is an identifier for uniquely identifying the information template. The user ID is an identifier for uniquely identifying the target user, and the user ID may be the mobile phone number of the target user. The target user refers to the user corresponding to the information to be pushed. Specifically, sending different services to the target user The information template needs to be developed for different service types, and the information template is stored in the server, and each information template corresponds to an information template ID.
S20:基于信息模板ID和用户ID,获取待推送信息,待推送信息包括长链接和信息内容。S20: Acquire the information to be pushed based on the information template ID and the user ID, where the information to be pushed includes long links and information content.
其中,待推送信息是指信息推送之前未经处理的信息。该待推送信息包括信息内容和至少一个长链接。该长链接是指待推送信息所对应业务的网页地址,如银行中不同类型的贷款所对应的网页地址。信息内容是指待推送信息中针对特定业务的信息内容。本实施例中,可根据信息生成指令中的信息模板ID和用户ID,获取待推送信息中的长链接和信息内容。The information to be pushed refers to information that has not been processed before the information is pushed. The information to be pushed includes information content and at least one long link. The long link refers to the webpage address of the service corresponding to the information to be pushed, such as the webpage address corresponding to different types of loans in the bank. The information content refers to the information content of the information to be pushed for a specific service. In this embodiment, the long link and the information content in the to-be-pushed information may be obtained according to the information template ID and the user ID in the information generation instruction.
如图2所示,步骤S20中,基于信息模板ID和用户ID,获取待推送信息,待推送信息包括长链接和信息内容,具体包括如下步骤:As shown in FIG. 2, in step S20, the information to be pushed is obtained based on the information template ID and the user ID, and the information to be pushed includes the long link and the information content, and specifically includes the following steps:
S21:基于信息模板ID,获取信息模板。S21: Acquire an information template based on the information template ID.
其中,信息模板是指预先根据相应业务配置的用于生成信息的模板,该信息模板预先存储在数据库中,并与唯一的信息模板ID关联,以便基于该模板ID查询获取相应的信息模板。本实施例中,信息模板包括但不限于用户信息模块、链接模块和信息内容模块。该用户信息模块与用户信息相关联,用于填充不同的用户信息。该链接模块是用于存储相应业务的网页地址的模块。信息内容模块是用于存储信息内容的模块,即针对特定业务的信息内容。可以理解地,每一信息模板中的链接模块和信息内容模块相匹配,即链接模块中的长链接可链接到与信息内容模块中的信息内容相关的网页地址。即该信息模板中的信息内容模块预先填充信息内容,而链接模块预先填充长链接。The information template refers to a template for generating information according to a corresponding service configuration, and the information template is pre-stored in a database and associated with a unique information template ID, so as to obtain a corresponding information template based on the template ID query. In this embodiment, the information template includes but is not limited to a user information module, a link module, and an information content module. The user information module is associated with user information for populating different user information. The link module is a module for storing a web page address of a corresponding service. The information content module is a module for storing information content, that is, information content for a specific service. It can be understood that the link module and the information content module in each information template match, that is, the long link in the link module can be linked to the webpage address related to the information content in the information content module. That is, the information content module in the information template is pre-filled with the information content, and the link module pre-populates the long link.
本实施例中,数据库预先存储不同业务类型所对应的信息模板,每一信息模板对应一信息模板ID,以使后续给目标用户发送推送信息时,基于信息生成指令中的信息模板ID直接调用相应的信息模板,节省时间,提高效率。In this embodiment, the database pre-stores information templates corresponding to different service types, and each information template corresponds to an information template ID, so that when the subsequent push information is sent to the target user, the information template ID in the information generation instruction is directly invoked accordingly. Information templates save time and increase efficiency.
S22:基于用户ID,获取与用户ID相对应的用户信息。S22: Acquire user information corresponding to the user ID based on the user ID.
其中,与用户ID相对应的用户信息包括但不限于用户的名字、性别、手机号、身份证号等信息。该用户信息预先存储在数据库中,在终端设备需推送信息时,可从数据库中基于不同的用户ID分别调取不同的用户信息,以便利用该用户信息形成待推送信息。The user information corresponding to the user ID includes, but is not limited to, the user's name, gender, mobile phone number, ID number, and the like. The user information is pre-stored in the database. When the terminal device needs to push the information, different user information may be separately retrieved from the database based on different user IDs, so that the user information is used to form the information to be pushed.
本实施例中,用户预先在手机或平板等移动终端上的应用程序(即(Application,简称APP)上完成注册,以使应用程序对应的服务器可获取相应的用户标识(即用户ID),该用户标识(即用户ID)可以为用户的手机号或身份证号等可唯一识别用户的标识。移动 终端获取用户注册时填写的信息后,将该用户信息上传到服务器中,以使服务器将用户信息存储在MySQL、Oracle等数据库中,并使每一用户信息与一用户标识(用户ID)关联存储。基于该用户标识(即用户ID),用户信息获取过程简单方便。In this embodiment, the user completes the registration on the application (ie, APP) on the mobile terminal such as the mobile phone or the tablet, so that the server corresponding to the application can obtain the corresponding user identifier (ie, the user ID). The user ID (ie, the user ID) may be a user's mobile phone number or ID number, etc., which can uniquely identify the user's identity. After obtaining the information filled in by the user, the terminal uploads the user information to the server, so that the server stores the user information in a database such as MySQL and Oracle, and associates each user information with a user identifier (user ID). . Based on the user identifier (ie, user ID), the user information acquisition process is simple and convenient.
S23:基于信息模板和用户信息,获取待推送信息。S23: Acquire the information to be pushed based on the information template and the user information.
本实施例中,步骤S21中获取的信息模板携带有长链接和信息内容,再将步骤S22获取到的用户信息填充到由步骤S21中获取的信息模板中的用户信息模块中,即可以获取待推送信息,使得该待推送信息携带长链接和信息内容。该获取待推送信息的过程无需人工干涉,节省时间。In this embodiment, the information template obtained in step S21 carries the long link and the information content, and the user information acquired in step S22 is filled in the user information module in the information template acquired in step S21, that is, the information template can be obtained. The information is pushed such that the information to be pushed carries long links and information content. The process of obtaining the information to be pushed does not require manual intervention, saving time.
S30:采用长链转短链算法对长链接进行转化,获取短链接。S30: Convert long links by long chain to short chain algorithm to obtain short links.
长链转短链算法是将长链接转换成短链接的算法。短链接是将长链接对应的网页地址进行转换处理后获取较简短的网页地址。步骤S30中采用长链转短链算法将长链接转换成短链接,以避免因长链接的网址字符串过长,导致推送信息的字符超过限制,往往要拆分成两条信息分别发送给目标用户的现象出现,从而节省发送成本,有利于提高用户体验。The long-chain to short-chain algorithm is an algorithm that converts long links into short links. The short link is to convert the web address corresponding to the long link to obtain a shorter web address. In step S30, the long-chain to short-chain algorithm is used to convert the long link into a short link, so as to avoid that the character string of the long-term link is too long, and the character of the push information exceeds the limit, and the information is often split into two pieces and sent to the target. The phenomenon of the user appears, thereby saving the transmission cost and contributing to the improvement of the user experience.
如图3所示,步骤S30中,采用长链转短链算法对长链接进行转化,获取短链接,具体包括如下步骤:As shown in FIG. 3, in step S30, a long-chain to short-chain algorithm is used to convert a long link to obtain a short link, which specifically includes the following steps:
S31:将长链接与预设关键值进行拼接,获取原始字节串。S31: splicing the long link with the preset key value to obtain the original byte string.
其中,原始字节串是长链接与预设关键值拼接后所得到的字节串。预设关键值为自定义的字节串,该预设关键值包括但不限于用户名字的缩写字母或用户名字的小写全拼。具体地,将长链接与预设关键值进行拼接具体是指直接将长链接与预设关键值合并,即将长链接所对应的字节串与预设关键值所对应的字节串相加可得到原始字节串,此拼接方法简单,易于实现。The original byte string is a byte string obtained by splicing a long link with a preset key value. The preset key value is a custom byte string including, but not limited to, an abbreviation of the user name or a lowercase full spell of the user name. Specifically, the splicing of the long link and the preset key value specifically refers to directly combining the long link with the preset key value, that is, adding the byte string corresponding to the long link and the byte string corresponding to the preset key value. The original byte string is obtained, and the splicing method is simple and easy to implement.
S32:采用信息-摘要算法对原始字节串进行加密处理,获取目标字节串。S32: Encrypt the original byte string by using an information-digest algorithm to obtain a target byte string.
其中,信息-摘要(message-digest algorithm,以下简称MD)算法就是把任意长的输入信息串变化成固定长度的输出串的一种函数,一般用于产生信息摘要,密钥加密等。本实施例中,采用MD算法的第五版本,即MD5算法,MD5具有安全性高的特点,使得用户信息不易泄露,保护用户隐私。其中,目标字节串是指采用信息-摘要算法将无固定长度的原始字节串转换为固定长度(128位二进制)的字节串即目标字节串。The message-digest algorithm (MD) algorithm is a function of changing an arbitrarily long input information string into a fixed-length output string, and is generally used for generating information digest, key encryption, and the like. In this embodiment, the fifth version of the MD algorithm, that is, the MD5 algorithm, is adopted, and the MD5 has the characteristics of high security, so that user information is not easily leaked and user privacy is protected. The target byte string refers to converting a raw byte string having no fixed length into a fixed length (128 bit binary) byte string, that is, a target byte string, by using an information-digest algorithm.
具体地,由于MD5以512位(即512位二进制)分组来处理输入的信息,且每一分组又被划分为16个32位子分组。因此,步骤S22中,采用MD5对原始字节串进行加密处理,以获取目标字节串具体包括如下步骤: Specifically, since MD5 processes the input information in 512-bit (ie, 512-bit binary) packets, each packet is further divided into 16 32-bit sub-packets. Therefore, in step S22, the original byte string is encrypted by using MD5 to obtain the target byte string, which specifically includes the following steps:
S321:将原始字节串的长度除以512,获取当前余数。S321: Divide the length of the original byte string by 512 to obtain the current remainder.
S322:判断当前余数是否为448。S322: Determine whether the current remainder is 448.
S323:若当前余数不是448,则基于当前余数确定待填充字节数,并在原始字节串中填充与待填充字节数数量一致个0,以获取中间字节串。然后再在中间字节串后面附加一个64位二进制表示的填充字节(以bit为单位),获取更新后的中间字节串,该更新后的中间字节串为(N+1)*512,是512的倍数。其中,填充字节为预先设置好的固定字节。S323: If the current remainder is not 448, determine the number of bytes to be padded based on the current remainder, and fill the original byte string with a number of 0s corresponding to the number of bytes to be padded to obtain an intermediate byte string. Then, a 64-bit binary representation padding byte (in bits) is appended to the intermediate byte string to obtain the updated intermediate byte string. The updated intermediate byte string is (N+1)*512. Is a multiple of 512. The padding byte is a fixed byte set in advance.
S324:若当前余数为448,则无需进行填充,直接将原始字节串作为更新后的中间字节串。S324: If the current remainder is 448, the original byte string is directly used as the updated intermediate byte string without padding.
S325:对中间字节串进行四轮循环运算,获取目标字节串。S325: Perform a four-round loop operation on the intermediate byte string to obtain a target byte string.
MD5中有四个32位被称作链接变量(Chaining Variable)的整数参数,本实施例中设为:A=0x01234567,B=0x89abcdef,C=0xfedcba98,D=0x76543210。当设置好这四个链接变量后,就开始进入MD5算法的四轮循环运算,循环的次数是信息中512位信息分组的数目,N+1次。There are four 32-bit integer parameters called the Chaining Variable in MD5. In this embodiment, it is set to: A=0x01234567, B=0x89abcdef, C=0xfedcba98, D=0x76543210. When these four link variables are set, they begin to enter the four-round loop operation of the MD5 algorithm. The number of loops is the number of 512-bit information packets in the message, N+1 times.
进一步地,四轮循环运算的操作包括将每一512位细分成16个小组,每个小组32位;将上述四个链接变量复制到另外四个变量(a、b、c、d)中,即A到a,B到b,C到c,D到d。主循环有四轮,每轮循环的操作都很相似。每一轮进行16次操作,每次操作对a、b、c和d中的其中三个变量作一次逻辑运算,然后将所得结果加上第四个变量(文本中的一个子分组和一个常数),然后再进行四次循环,得到新的A、B、C和D这四个链接变量,将其按照ABCD的顺序级联并输出得到128位二进制(16字节)的MD5值即目标字节串。具体地,将每次操作的计算结果循环右移4位,再进行下一次操作。每轮循环后将A、B、C和D分别加上a、b、c和d,再进入下一轮循环。Further, the operation of the four-round loop operation includes subdividing each 512 bits into 16 groups of 32 bits each; copying the above four link variables into the other four variables (a, b, c, d) , ie A to a, B to b, C to c, D to d. The main loop has four rounds, and the operation of each round is very similar. Perform 16 operations per round, perform a logical operation on each of the three variables a, b, c, and d, and then add the result to the fourth variable (a subgroup and a constant in the text) ), then four more cycles, get the new four link variables A, B, C and D, cascading them in the order of ABCD and outputting the MD5 value of the 128-bit binary (16 bytes), ie the target word Section string. Specifically, the calculation result of each operation is cyclically shifted right by 4 bits, and the next operation is performed. After each round of cycles, add A, B, C, and D to a, b, c, and d, respectively, and go to the next cycle.
具体地,每一轮逻辑运算的逻辑运算公式如下:第一轮逻辑运算公式为F(x,y,z)=(x&y)|((~x)&z);第二轮逻辑运算公式为G(x,y,z)=(x&z)|(y&(~z));第三轮逻辑运算公式为H(x,y,z)=x∧y∧z;第四轮逻辑运算公式为I(X,Y,Z)=y∧(x|(~z))。其中,符号&代表与运算,符号~代表取非运算,符号∧代表异或运算。与运算、取非运算和异或运算均是计算机中一种基本的逻辑运算方式。与运算规则为:0&0=0,0&1=0,1&0=0,1&1=1,即两位同时为“1”,结果才为“1”,否则为0。取非运算的运算规则为~0=1,~1=0;即“0”结果为“1”,非“1”结果为“0”。异或运算的运算规则为0^0=0,0^1=1,1^0=1,1^1=0;即两位相同为“1”,不同为“0”。 Specifically, the logical operation formula of each round of logical operation is as follows: the first round of logical operation formula is F(x, y, z)=(x&y)|((~x)&z); the second round of logical operation formula is G (x, y, z)=(x&z)|(y&(~z)); The third round of logical operation formula is H(x, y, z)=x∧y∧z; the fourth round of logical operation formula is I (X, Y, Z) = y ∧ (x | (~ z)). Among them, the symbol & represents the AND operation, the symbol ~ represents the non-operation, and the symbol ∧ represents the exclusive OR operation. The AND, NAND, and XOR operations are a basic logic operation in a computer. The operation rule is: 00&0=0,0&1=0, 1&0=0, 1&1=1, that is, both bits are “1” at the same time, the result is “1”, otherwise it is 0. The operation rule for taking the non-operation is ~0=1, ~1=0; that is, the result of “0” is “1”, and the result of non-“1” is “0”. The operation rule of the exclusive OR operation is 0^0=0, 0^1=1, 1^0=1, 1^1=0; that is, the two bits are the same as “1” and the difference is “0”.
本实施例中,四轮循环运算的操作可以采用如下公式表示:FF(a,b,c,d,Mj,s,ti),表示a=b+((a+F(b,c,d)+Mj+ti)<<<s));GG(a,b,c,d,Mj,s,ti),表示a=b+((a+G(b,c,d)+Mj+ti)<<<s);HH(a,b,c,d,Mj,s,ti),表示a=b+((a+H(b,c,d)+Mj+ti)<<<s);II(a,b,c,d,Mj,s,ti),表示a=b+((a+I(b,c,d)+Mj+ti)<<<s)。其中Mj代表16个小组中的第j个分组,“<<<s”代表循环左移s位,ti代表第i步中的常数,即为232*abs(sin(i))的整数部分,i的取值为1-64,i的单位是弧度。本实施例中,在每一轮循环中,都将按照预设数组s(循环移动的位移量),按照数组顺序依次循环选取s值,直到每轮循环结束。可以理解地,每一轮循环中的s数组是不同的,第一轮循环中,s={7,12,17,22},第二轮循环中,s={5,9,14,20},第三轮循环中,s={4,11,16,23},第四轮循环中,s={6,10,15,21}。由于MD5加密算法的安全性极高,使得本实施例中发送的包含用户信息的推送信息更加可靠,不易泄露用户个人信息从而保证用户的个人利益。In this embodiment, the operation of the four-round loop operation can be expressed by the following formula: FF(a, b, c, d, M j , s, ti), indicating a=b+((a+F(b,c,d) ) +M j +ti)<<<s)); GG(a,b,c,d,M j ,s,ti), indicating a=b+((a+G(b,c,d)+M j + ti) <<<s); HH (a, b, c, d, M j , s, ti), indicating a = b + ((a + H (b, c, d) + M j + ti) <<<s);II(a,b,c,d,M j ,s,ti), indicating a=b+((a+I(b,c,d)+M j +ti)<<<s ). Where M j represents the jth group of the 16 groups, "<<<s" represents the left shift of the s bit, and ti represents the constant in the ith step, which is an integer of 2 32 *abs(sin(i)) In part, the value of i is 1-64, and the unit of i is radians. In this embodiment, in each round of the loop, the s value will be sequentially cycled according to the preset array s (the amount of displacement of the cyclic movement) in the order of the array until the end of each round of the loop. Understandably, the s array in each round is different. In the first round of the cycle, s={7,12,17,22}, in the second round, s={5,9,14,20 }, in the third round of the cycle, s={4,11,16,23}, in the fourth round of the cycle, s={6,10,15,21}. Because the security of the MD5 encryption algorithm is extremely high, the push information including the user information sent in this embodiment is more reliable, and it is not easy to disclose the user's personal information to ensure the personal interests of the user.
S33:对目标字节串进行字符型转换,获取目标字符串。S33: Perform character conversion on the target byte string to obtain a target string.
其中,目标字符串是指将目标字节串(128位二进制)转换为十六进制的字符串。由于计算机中对字符串的处理一般是对十六进制字符串进行处理,因此,将目标字节串(即128位二进制的MD5值)转换为十六进制字符串(即32位目标字符串。Among them, the target string refers to a string that converts the target byte string (128-bit binary) into hexadecimal. Since the processing of strings in the computer is generally processing hex strings, the target byte string (that is, the MD5 value of 128-bit binary) is converted into a hexadecimal string (that is, a 32-bit target character). string.
具体地,将目标字节串转换成目标字符串具体过程如下:将16字节(128位)的目标字节串循环取出并对取出的每一字节进行转换,以获取十六进制字符,由于每一字节代表8位二进制,因此,需先将每个字节中的高四位进行转换,再对每个字节中的低四位进行转换,最后将每一字节转换得到的字符输出,以获取目标字符串。将每一字节转换为十六进制字符的具体转换公式为hexDigits[byte0>>>4&0xf],hexDigits[byte0&0xf],符号>>>代表循环右移,符号&代表按位与运算,hexDigits[](十六进制)是指将字节串转换为十六进制字符串的算法。本实施例中,将目标字节串转换为十六进制的目标字符串,可有效避免基于MD5获取的目标字节串存在乱码现象,从而有效提高后续的处理速度,提高效率。Specifically, the process of converting the target byte string into the target string is as follows: a 16-byte (128-bit) target byte string is looped out and each byte taken is converted to obtain a hexadecimal character. Since each byte represents an 8-bit binary, it is necessary to first convert the upper four bits of each byte, then convert the lower four bits of each byte, and finally convert each byte. Character output to get the target string. The specific conversion formula for converting each byte to a hexadecimal character is hexDigits[byte0>>>4&0xf], hexDigits[byte0&0xf], the symbol >>> represents the right shift of the loop, the symbol & represents the bitwise AND operation, hexDigits[ ] (hexadecimal) is an algorithm that converts a string of bytes into a hexadecimal string. In this embodiment, the target byte string is converted into a hexadecimal target string, which can effectively avoid the garbled phenomenon of the target byte string acquired based on the MD5, thereby effectively improving the subsequent processing speed and improving efficiency.
S34:对目标字符串按位划分,获取八位十六进制数。S34: Bitwise dividing the target string to obtain an eight-digit hexadecimal number.
其中,对目标字符串的按位划分具体是指将步骤S32中得到的目标字符串(32位十六进制)的进行等长度划分,即将目标字符串按八位一组进行划分,以获取4组字符串组, 每组字符串组中都包含八位十六进制数,易于计算。The bitwise division of the target character string specifically refers to dividing the target character string (32-bit hexadecimal) obtained in step S32 into equal lengths, that is, dividing the target character string into groups of eight to obtain 4 groups of string groups, Each set of string groups contains eight hexadecimal numbers, which is easy to calculate.
S35:将八位十六进制数与十六进制的第一预设值进行按位与运算,获取第一下标值。S35: Perform bitwise AND operation on the eight-digit hexadecimal number and the first preset value in hexadecimal to obtain the first subscript value.
其中,第一预设值为自定义的十六进制数。本实施例中,第一预设值为十六进制数0x3FFFFFFF,将步骤S34中获取到的四组八位十六进制数分别与第一预设值即0x3FFFFFFF进行按位与运算,由于得到的运算结果是32位的有效长度,因此,需选取运算后结果的低30位的数值即去掉前面两位,以获取第一下标值。具体地,按位与运算是计算机中一种基本的逻辑运算方式,符号表示为&,其运算规则为:0&0=0,0&1=0,1&0=0,1&1=1;即两位同时为“1”,结果才为“1”,否则为0。The first preset value is a custom hexadecimal number. In this embodiment, the first preset value is a hexadecimal number 0x3FFFFFFF, and the four sets of eight-digit hexadecimal numbers obtained in step S34 are respectively bit-wise-operated with the first preset value, that is, 0x3FFFFFFF, because The obtained operation result is the effective length of 32 bits. Therefore, it is necessary to select the lower 30 bits of the result of the operation, that is, remove the first two bits to obtain the first subscript value. Specifically, bitwise AND operation is a basic logical operation method in a computer, and the symbol is represented as &, and its operation rule is: 00&0=0, 00&1=0, 1&0=0, 1&1=1; that is, two bits are simultaneously 1", the result is "1", otherwise it is 0.
S36:将第一下标值与十六进制的第二预设值进行按位与运算,获取第二下标值。S36: Perform a bitwise AND operation on the first subscript value and the second preset value in hexadecimal to obtain a second subscript value.
其中,第二预设值为自定义的十六进制数。进一步地,将由步骤S35获取到的第一下标值与第二预设值进行按位与运算。本实施例中,第二预设值为十六进制数0x0000003D,将第一下标值与0x0000003D进行按位与运算得到第二下标值。The second preset value is a custom hexadecimal number. Further, the first subscript value obtained by step S35 and the second preset value are subjected to bitwise AND operation. In this embodiment, the second preset value is a hexadecimal number 0x0000003D, and the first subscript value and the 0x0000003D are bitwise ANDed to obtain a second subscript value.
S37:从预设字符数组中获取与第二下标值相对应的字符,形成短链接。S37: Obtain a character corresponding to the second subscript value from the preset character array to form a short link.
其中,预设字符数组是预先定义的字符型数组,其包含用于生成短链接的字符。本实施例中,该预设字符数组包括但不限于大写英文字符、小写英文字母和阿拉伯数字(0到9)。通过步骤S36获取到的第二下标值,获取预设字符数组的索引。基于预设字符数组的索引,从预设字符数组中循环选取与第二下标值所对应的字符,每次循环都将取出的字符相加,然后再向右移5位,进入下次循环,获取候选短链接。从候选链接中随机选取一个短链接,以获取所需的短链接。具体地,基于预设字符数组的索引,循环6次取出预设字符数组中的字符,得到6个字符,即得到一个候选短链接,由于步骤S324中存在4次循环运算,每一次循环都得到一个候选短链接,最终会得到4个候选短链接。最后,从4个候选短链接中随机选取一个候选短链接作为最终的短链接。Among them, the preset character array is a pre-defined character array containing characters for generating short links. In this embodiment, the preset character array includes but is not limited to uppercase English characters, lowercase English letters, and Arabic numerals (0 to 9). The index of the preset character array is obtained by the second subscript value obtained in step S36. Based on the index of the preset character array, the characters corresponding to the second subscript value are cyclically selected from the preset character array, and the extracted characters are added each time, and then moved to the right by 5 bits to enter the next loop. , get candidate short links. Randomly pick a short link from the candidate links to get the short links you need. Specifically, based on the index of the preset character array, the characters in the preset character array are taken out 6 times to obtain 6 characters, that is, a candidate short link is obtained, and since there are 4 loop operations in step S324, each loop is obtained. A candidate short link will eventually get 4 candidate short links. Finally, one candidate short link is randomly selected from the four candidate short links as the final short link.
具体地,通过步骤S36获取到的第二下标值,获取预设字符数组的索引所采用的方法是Index函数。Index函数是返回表或区域中的值或对值的引用。Index函数有两种形式:数组形式和引用形式。数组形式通常返回数值(本实施例中采用数值形式返回预设字符数组的索引)或数值数组;引用形式通常返回引用。Specifically, the method used to obtain the index of the preset character array by using the second subscript value obtained in step S36 is an Index function. The Index function returns a value in a table or region or a reference to a value. The Index function has two forms: an array form and a reference form. The array form usually returns a numeric value (in this embodiment, the index of the default character array is returned in numeric form) or an array of values; the reference form usually returns a reference.
具体地,在候选短链接中选取短链接时,服务器会判断候选短链接与服务器中已存储的短链接是否相同,若候选短链接中与服务器已存储的短链接相同时,可直接剔除该候选短链接,在余下的服务器已存储的短链接不相同的候选短链接中,随机选取一个候选短链接作为最终的短链接,该选取短链接的过程可有效避免重复的问题,使得推送的信息具有 唯一性与针对性。Specifically, when the short link is selected in the candidate short link, the server determines whether the candidate short link is the same as the short link stored in the server, and if the candidate short link is the same as the short link stored by the server, the candidate can be directly rejected. The short link, in the candidate short links in which the remaining short links of the remaining servers are stored, a candidate short link is randomly selected as the final short link, and the process of selecting the short link can effectively avoid the problem of repetition, so that the pushed information has Uniqueness and pertinence.
S40:基于短链接和信息内容,获取目标推送信息。S40: Acquire target push information based on short links and information content.
其中,短链接是步骤S30获取到的与待推送信息中的长链接相对应的短链接,信息内容是步骤S20获取到的信息模板中的针对特定业务的信息内容,将信息内容填充到信息模板中的信息内容模块,将短链接填充到信息模板中的链接模块,即获取目标推送信息,并将目标推送信息存储在缓存服务器中。The short link is the short link corresponding to the long link in the information to be pushed acquired in step S30, and the information content is the information content for the specific service in the information template acquired in step S20, and the information content is filled into the information template. In the information content module, the short link is filled into the link module in the information template, that is, the target push information is acquired, and the target push information is stored in the cache server.
缓存服务器采用包括但不限于本实施例中的缓冲存储方式存储目标推送信息。缓冲存储是将需要频繁访问的网络内容存放在离用户较近、访问速度更快的系统中,以提高内容访问速度的一种技术。缓存服务器就是存放频繁访问内容的服务器,使得用户访问信息的速度更快,提升用户体验。The cache server stores the target push information by using a buffer storage method including but not limited to the embodiment. Buffer storage is a technology that increases the speed of content access by storing network content that needs frequent access in a system that is closer to the user and faster to access. A cache server is a server that stores frequently accessed content, enabling users to access information faster and improve the user experience.
S50:将目标推送信息发送给与用户ID相对应的客户端。S50: Send the target push information to the client corresponding to the user ID.
其中,客户端(Client)或称为用户端,是指与服务器相对应,为客户提供本地服务的终端。本实施例中,用户ID包括但不限于目标用户的手机号,相应地,与用户ID相对应的客户端为手机。即步骤S50中服务器会根据用户的手机号,将步骤S40获取到的目标推送信息发送到用户的客户端(即手机)上,以使客户端显示该目标推送信息。The client (client) or client refers to a terminal that corresponds to the server and provides local services to the client. In this embodiment, the user ID includes but is not limited to the mobile phone number of the target user, and correspondingly, the client corresponding to the user ID is the mobile phone. That is, in step S50, the server sends the target push information acquired in step S40 to the client (ie, the mobile phone) of the user according to the mobile phone number of the user, so that the client displays the target push information.
服务器发送目标推送信息到客户端的方式包括但不限于定时发送方式,可以在每周的固定日期的固定时间发送,并读取发送时间以及标记该发送时间。采用Date(日期)方法读取发送时间,以返回当日的日期和时间。可以理解地,服务器每发送一个目标推送信息都会对其发送时间进行标记,使得目标推送信息具有时序性。The manner in which the server sends the target push information to the client includes, but is not limited to, a timed transmission method, which can be sent at a fixed time on a fixed date of the week, and reads the transmission time and marks the transmission time. Use the Date method to read the send time to return the date and time of the day. Understandably, each time a server sends a target push message, its sending time is marked, so that the target push information is time-series.
本实施例中,先获取信息生成指令,该信息生成指令包括信息模板ID和用户ID,以便基于信息模板ID和用户ID,获取与用户相对应的待推送信息,该待推送信息包括信息内容和长链接。根据信息生成的指令调取信息模板,该过程无需人工编辑,节省时间,使得信息推送的效率更高。接着采用长链转短链算法对长链接进行转化,获取短链接。最后,将目标推送信息定时发送给与用户ID相对应的客户端并获取发送时间,使得目标推送信息更具时序性。该信息推送方法进行信息推送时,避免因链接过长超过短信限制字数而需将信息分段发送给用户,有利于降低信息发送量,节省发送成本。In this embodiment, the information generation instruction is obtained, where the information generation instruction includes an information template ID and a user ID, so as to acquire information to be pushed corresponding to the user based on the information template ID and the user ID, where the information to be pushed includes information content and Long link. The information template is retrieved according to the instruction generated by the information, and the process does not need manual editing, which saves time and makes the information pushing more efficient. Then use the long-chain to short-chain algorithm to convert long links and get short links. Finally, the target push information is periodically sent to the client corresponding to the user ID and the transmission time is acquired, so that the target push information is more sequential. When the information push method is used for information push, it is avoided that the information is segmented and sent to the user because the link length is longer than the number of the short message limit word, which is beneficial to reducing the amount of information sent and saving the transmission cost.
在一具体实施方式中,如图4所示,步骤S50之后,该信息推送方法还包括如下步骤:In a specific embodiment, as shown in FIG. 4, after step S50, the information pushing method further includes the following steps:
S61:获取客户端发送的响应信息。S61: Acquire response information sent by the client.
具体地,当服务器发送目标推送信息到与用户ID所对应的客户端时,客户端会在接收到目标推送信息时自动向服务器发送的响应信息,使得服务器知晓客户端是否接收到信 息,并基于响应信息判断是否需给客户端重新发送目标推送信息。本实施例中,服务器在接收响应信息时会读取当前系统时间并记录,以使其发送的响应信息包含当前系统时间。Specifically, when the server sends the target push information to the client corresponding to the user ID, the client automatically sends the response information to the server when receiving the target push information, so that the server knows whether the client receives the letter. Information, and based on the response information to determine whether the target push information needs to be resent to the client. In this embodiment, the server reads the current system time and records when receiving the response information, so that the response information sent by the server includes the current system time.
S62:判断接收响应信息的当前响应时间是否超过预设响应时间。S62: Determine whether the current response time of the received response information exceeds a preset response time.
其中,预设响应时间为系统原先设定的响应时间。当前响应时间为服务器接收到响应信息时获取的系统时间与发送该目标推送信息的系统时间(即发送时间)的差值,即步骤S61中获取的系统时间与步骤S40中获取的服务器发送目标推送信息时所读取的当前时间的差值。The preset response time is the response time originally set by the system. The current response time is the difference between the system time acquired when the server receives the response information and the system time (ie, the transmission time) for transmitting the target push information, that is, the system time acquired in step S61 and the server sending target push acquired in step S40. The difference in the current time read by the message.
S63:若当前响应时间超过预设响应时间,则将目标推送信息重新发送给与用户ID相对应的客户端。S63: If the current response time exceeds the preset response time, the target push information is resent to the client corresponding to the user ID.
本实施例中,服务器在将目标推送信息发送与用户ID行对应的客户端时,会将所发送的目标推送信息缓存在服务器中,并记录发送该目标推送信息的系统时间(即发送时间),以便计算当前响应时间,在当前响应时间超过预设响应时间或者在超过预设响应时间还没有收到响应信息时,直接调用服务器缓冲存储的目标推送信息发送到客户端,节省时间,提高效率。In this embodiment, when the server sends the target push information to the client corresponding to the user ID row, the server caches the sent target push information in the server, and records the system time (ie, the sending time) of transmitting the target push information. In order to calculate the current response time, when the current response time exceeds the preset response time or when the response information has not been received before the preset response time, the target push information of the server buffer storage is directly sent to the client, saving time and improving efficiency. .
在一具体实施方式中,该信息推送方法中,步骤S30之后且步骤S40之前还包括如下步骤:对短链接进行标注,以使短链接携带短链标识。具体地,将步骤S30获取的短链接进行标注,使得短链接与其对应的长链接具有映射关系,并将携带有短链标识的短链接与其对应的长链接关联存储在数据库中,在数据库中创建链接信息表,链接信息表中存储有具有映射关系的短链接、长链接、短链标识和长链接内容,以便基于该链接信息表可简单快捷的根据短链接查找数据库以获得所对应的长链接内容。本实施例中,长链接内容包括但不限于与长链接对应的业务类型的网页内容。In a specific implementation manner, in the information pushing method, after step S30 and before step S40, the method further includes the step of: marking the short link so that the short link carries the short-chain identifier. Specifically, the short link acquired in step S30 is marked, so that the short link has a mapping relationship with the corresponding long link, and the short link carrying the short chain identifier is associated with the corresponding long link and stored in the database, and is created in the database. a link information table in which a short link, a long link, a short chain identifier, and a long link content having a mapping relationship are stored, so that the database can be quickly and easily searched according to the short link to obtain a corresponding long link based on the link information table. content. In this embodiment, the long link content includes, but is not limited to, webpage content of a service type corresponding to the long link.
该具体实施方式中,步骤S50之后,该信息推送方法还包括步骤S70:将与所述目标推送信息对应的网页内容发送到客户端。如图5所示,步骤S70具体包括如下步骤:In this embodiment, after the step S50, the information pushing method further includes a step S70: sending the webpage content corresponding to the target pushing information to the client. As shown in FIG. 5, step S70 specifically includes the following steps:
S71:接收客户端发送的访问请求,访问请求包括短链标识。S71: Receive an access request sent by the client, where the access request includes a short-chain identifier.
具体地,步骤S50之后,客户端会显示服务器发送的目标推送信息,该目标推送信息包含短链接和信息内容,用户通过客户端查看目标推送信息时,可能会点击信息中的短链接进行查看,此时客户端会接收用户点击的短链接而输入的访问请求,并将该访问请求发送给服务器,以使服务器获取客户端发送的访问请求。该访问请求包括短链标识,以便基于该短链标识查找对应的长链接。Specifically, after step S50, the client displays the target push information sent by the server, and the target push information includes a short link and the information content. When the user views the target push information through the client, the short link may be clicked to view the information. At this time, the client receives the access request input by the short link clicked by the user, and sends the access request to the server, so that the server obtains the access request sent by the client. The access request includes a short chain identifier to find a corresponding long link based on the short chain identifier.
S72:基于短链标识查找对应的长链接,获取与长链接对应的网页内容。 S72: Search for the corresponding long link based on the short-chain identifier, and obtain the content of the webpage corresponding to the long link.
具体地,服务器会根据短链接所携带的短链标识在数据库中查找所对应的长链接。其中,数据库中存储有链接信息表,该链接信息表包括但不限于长链接、短链接、短链标识和与长链接对应的网页内容(即长链接内容)。可以理解地,基于短链标识查找到对应的长链接,再根据长链接查找到对应的网页内容,该过程无需将短链接通过转换方法转换为长链接,只需通过短链标识直接查找到对应的长链接,节省时间,提升用户体验。Specifically, the server searches for the corresponding long link in the database according to the short-chain identifier carried by the short link. The database stores therein a link information table including, but not limited to, a long link, a short link, a short chain identifier, and web content corresponding to the long link (ie, long link content). It can be understood that the short link identifier is used to find the corresponding long link, and then the corresponding web page content is found according to the long link. The process does not need to convert the short link into a long link through the conversion method, and only needs to find the corresponding directly through the short chain identifier. Long links save time and improve user experience.
S73:将网页内容发送给客户端。S73: Send the webpage content to the client.
其中,网页内容是指与长链接所对应的网页内容。服务器可基于短链标识在数据库中查找所对应的长链接,再根据长链接查找到所对应的网页内容,并将其发送到客户端。其中,服务器预先关联存储与短链标识关联的长链接对应的网页内容,使得后续在通过长链接查找对应的网页内容时更加便捷。The webpage content refers to webpage content corresponding to the long link. The server can find the corresponding long link in the database based on the short-chain identifier, and then find the corresponding webpage content according to the long link and send it to the client. The server pre-associates the webpage content corresponding to the long link associated with the short-chain identifier, so that it is more convenient to find the corresponding webpage content through the long link.
本实施例中,服务器接收客户端发送的访问请求,并向客户端返回短链接所对应的长链接的网页内容,客户端会接收服务器所发送的网页内容并将其显示在客户端。其中,网页内容具体为H5(超文本标记语言,简称HTML5)界面,方便用户查看。超文本标记语言是标准通用标记语言下的一个应用。“超文本”是指页面内可以包含图片、链接,甚至音乐、程序等非文字元素。超文本标记语言的结构包括“头”部分、和“主体”部分,其中“头”部提供关于网页的信息(即网页的标题、序言、说明等内容)“主体”部分提供网页的具体内容。In this embodiment, the server receives the access request sent by the client, and returns the web content of the long link corresponding to the short link to the client, and the client receives the webpage content sent by the server and displays it on the client. Among them, the content of the webpage is specifically H5 (Hypertext Markup Language, referred to as HTML5) interface, which is convenient for users to view. Hypertext Markup Language is an application under the standard universal markup language. "Hypertext" means that the page can contain images, links, and even non-text elements such as music and programs. The structure of the hypertext markup language includes a "header" portion, and a "body" portion, wherein the "header" portion provides information about the web page (ie, the title, preamble, description, etc. of the web page). The "subject" portion provides the specific content of the web page.
在一具体实施方式中,如图6所示,该信息推送方法还包括如下步骤:In a specific implementation, as shown in FIG. 6, the information pushing method further includes the following steps:
S81:统计服务器缓存的目标推送信息的当前缓存时间和当前缓存数量。S81: The current cache time and the current cache number of the target push information cached by the statistics server.
其中,目标推送信息的当前缓存时间是指服务器缓存已发送的目标推送信息的时间,具体为服务器的系统时间与发送该目标推送时间(即发送时间)的差值。当前缓存数量为服务器当前缓存的所有已发送的目标推送信息的数量。本实施例中,终端设备内置有用于统计当前缓存时间和当前缓存数量的脚本,并设置该脚本为定时运行,以自动统计当前缓存时间和当前缓存数量,使得此过程无需人工干涉,提高工作效率。The current cache time of the target push information refers to the time when the server caches the target push information that has been sent, which is specifically the difference between the system time of the server and the sending of the target push time (ie, the sending time). The current number of caches is the amount of all sent target push information currently cached by the server. In this embodiment, the terminal device has a script for collecting the current cache time and the current cache number, and setting the script to run periodically to automatically count the current cache time and the current cache number, so that the process does not require manual intervention and improves work efficiency. .
具体地,服务器还会判断当前缓存时间是否超过预设缓存时间。其中,预设缓存时间是系统预先设置好的缓存时间。服务器在每发送一个目标推送信息时,记录目标推送信息的发送时间,再根据服务器的系统时间与该发送时间确定当前缓存时间,然后再判断当前缓存时间是否超过预设缓存时间。如预先定义的预约缓存时间为3个月,目标推送信息的当前缓存时间为2个月,则没有超过预设缓存时间。本实施例中,将当前缓存时间超过预设缓存时间作为删除缓存的目标推送信息的一个判断条件,以减少缓存数量,避免因缓存 量过大,导致服务器异常的问题。Specifically, the server also determines whether the current cache time exceeds a preset cache time. The preset cache time is a preset cache time of the system. The server records the sending time of the target push information every time a target push information is sent, and then determines the current cache time according to the system time of the server and the sending time, and then determines whether the current cache time exceeds the preset cache time. If the pre-defined reservation cache time is 3 months and the current cache time of the target push information is 2 months, the preset cache time is not exceeded. In this embodiment, the current cache time exceeds the preset cache time as a judgment condition for deleting the target push information of the cache, so as to reduce the number of caches and avoid caching. The amount is too large, causing the server to be abnormal.
具体地,服务器还会判断当前缓存数量是否超过预设缓存数量。其中,预设缓存量是指系统预先设置好的缓存数量。当前缓存数量是指服务器当前缓存的所有已发送的目标推送信息的数量。本实施例中,将当前缓存数量超过预设缓存数量作为删除缓存的目标推送信息的另一个判断条件,可有效避免由于缓存数量超载导致服务器崩溃的问题。Specifically, the server also determines whether the current number of caches exceeds a preset number of caches. The preset cache amount refers to the number of caches preset by the system. The current cache count refers to the amount of all sent target push information currently cached by the server. In this embodiment, the current cache number exceeds the preset cache number as another judgment condition for deleting the target push information of the cache, which can effectively avoid the problem that the server crashes due to the overload of the cache number.
S82:若当前缓存时间超过预设缓存时间,和/或当前缓存数量超过预设缓存数量,则删除目标推送信息。S82: If the current cache time exceeds the preset cache time, and/or the current cache number exceeds the preset cache quantity, the target push information is deleted.
步骤S82中删除目标推送信息存在如下三种情况:一是当前缓存时间超过预设缓存时间且当前缓存数量超过预设缓存数量,则删除目标推送信息。二是当前缓存时间未超过预设缓存时间而当前缓存数量超过预设缓存数量,则删除目标推送信息。三是当前缓存时间超过预设缓存时间但当前缓存数量未超过预设缓存数量,则删除目标推送信息。There are three cases in which the target push information is deleted in step S82. First, if the current cache time exceeds the preset cache time and the current cache number exceeds the preset cache number, the target push information is deleted. Second, if the current cache time does not exceed the preset cache time and the current cache number exceeds the preset cache number, the target push information is deleted. Third, if the current cache time exceeds the preset cache time but the current cache number does not exceed the preset cache number, the target push information is deleted.
本实施例中,设当前缓存时间为A,预设缓存时间B,当前缓存数量为C,预设缓存数量D,A>B=0,A<B=1,C<D=1,C>D=0。当(A>B)&&(C>D)或者(A<B)&&(C>D)或者(A>B)&&(C<D)时,删除目标推送信息,以节省服务器的存储空间。其中,符号&&为逻辑与运算,其运算规则为0&&0=0,0&&1=0,1&&0=0,1&&1=1,即当运算结果输出为0时,需删除目标推送信息。由于服务器发送的每一目标推送信息都携带有时间标记(即记录有发送时间),因此,可根据时间标记删除时间在先的目标推送信息,以达到节省服务器的存储空间。In this embodiment, the current cache time is A, the preset cache time B, the current cache number is C, the preset cache number D, A>B=0, A<B=1, C<D=1, C> D=0. When (A>B)&&(C>D) or (A<B)&&(C>D) or (A>B)&&(C<D), the target push information is deleted to save the storage space of the server. The symbol && is a logical AND operation, and the operation rule is 0&&0=0, 0&&1=0, 1&&0=0, 1&&1=1, that is, when the operation result output is 0, the target push information needs to be deleted. Since each target push information sent by the server carries a time stamp (that is, the record has a transmission time), the target push information at the time can be deleted according to the time stamp, so as to save the storage space of the server.
本实施例中,先获取信息生成指令,该信息生成指令包括信息模板ID和用户ID,以便基于信息模板ID和用户ID,获取与用户相对应的待推送信息,该待推送信息包括信息内容和长链接。根据信息生成指令调取信息模板,该过程无需人工编辑,节省时间,使得信息推送的效率更高。接着采用长链转短链算法对长链接进行转化,获取短链接,避免服务器发送的目标推送信息时,因链接过长超过短信限制字数而需将信息分段发送给用户,有利于降低信息发送量,节省发送成本,并可提升用户体验。最后,将目标推送信息发送给与用户ID相对应的客户端,获取当前缓存时间和当前缓存数量,将当前缓存时间和当前缓存数量分别与预设缓存时间和预设缓存数量进行比较判断,基于比较判断结果删除无用的目标推送信息,以达到节省服务器的存储空间,降低服务器的负载的目的,可有效避免因服务器过载而导致服务器崩溃的问题,提升服务器的性能。In this embodiment, the information generation instruction is obtained, where the information generation instruction includes an information template ID and a user ID, so as to acquire information to be pushed corresponding to the user based on the information template ID and the user ID, where the information to be pushed includes information content and Long link. The information template is retrieved according to the information generation instruction, and the process does not need manual editing, which saves time and makes the information push more efficient. Then use the long-chain to short-chain algorithm to convert the long link and obtain the short link. When the target push information sent by the server is avoided, the information needs to be sent to the user segmentally because the link is too long. Quantity, saving on sending costs and improving user experience. Finally, the target push information is sent to the client corresponding to the user ID, and the current cache time and the current cache number are obtained, and the current cache time and the current cache number are compared with the preset cache time and the preset cache number respectively, based on The comparison result deletes the useless target push information, so as to save the storage space of the server and reduce the load of the server, thereby effectively avoiding the server crash caused by the server overload and improving the performance of the server.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。 It should be understood that the size of the sequence of the steps in the above embodiments does not mean that the order of execution is performed. The order of execution of each process should be determined by its function and internal logic, and should not be construed as limiting the implementation process of the embodiments of the present application.
实施例2Example 2
图7示出与实施例1中信息推送方法一一对应的信息推送装置的原理框图。如图7所示,该信息推送装置包括信息生成指令模块10、待推送信息获取模块20、短链接获取模块30、目标推送信息获取模块40、目标推送信息发送模块50、短链接标注模块90和网页内容发送模块70。其中,信息生成指令模块10、待推送信息获取模块20、短链接获取模块30、目标推送信息获取模块40、目标推送信息发送模块50、短链接标注模块90和网页内容发送模块70。的实现功能与实施例中信息推送方法对应的步骤一一对应,为避免赘述,本实施例不一一详述。Fig. 7 is a block diagram showing the principle of the information pushing apparatus corresponding to the information pushing method in the first embodiment. As shown in FIG. 7, the information pushing apparatus includes an information generating instruction module 10, a to-be-pushed information acquiring module 20, a short link acquiring module 30, a target pushing information acquiring module 40, a target pushing information transmitting module 50, a short link labeling module 90, and Web content sending module 70. The information generation instruction module 10, the to-be-pushed information acquisition module 20, the short link acquisition module 30, the target push information acquisition module 40, the target push information sending module 50, the short link labeling module 90, and the webpage content sending module 70. The implementation functions are in one-to-one correspondence with the steps corresponding to the information pushing method in the embodiment. To avoid redundancy, the present embodiment is not described in detail.
信息生成指令模块10,用于获取信息生成指令,信息生成指令包括信息模板ID和用户ID。The information generation instruction module 10 is configured to acquire an information generation instruction, where the information generation instruction includes an information template ID and a user ID.
待推送信息获取模块20,用于基于信息模板ID和用户ID,获取待推送信息,待推送信息包括长链接和信息内容。The to-be-push information acquiring module 20 is configured to obtain the to-be-pushed information based on the information template ID and the user ID, and the to-be-pushed information includes a long link and an information content.
短链接获取模块30,用于采用长链转短链算法对长链接进行转化,获取短链接。The short link obtaining module 30 is configured to convert the long link by using a long chain to short chain algorithm to obtain a short link.
目标推送信息获取模块40,用于基于短链接和所述信息内容,获取目标推送信息。The target push information obtaining module 40 is configured to acquire target push information based on the short link and the information content.
目标推送信息发送模块50,用于将目标推送信息发送给与用户ID相对应的客户端。The target push information sending module 50 is configured to send the target push information to the client corresponding to the user ID.
短链接标注模块90,用于对短链接进行标注,以使短链接携带短链标识Short link labeling module 90 for labeling short links so that short links carry short chain identifiers
网页内容发送模块70,用于将与目标推送信息对应的网页内容发送到客户端。The webpage content sending module 70 is configured to send the webpage content corresponding to the target push information to the client.
优选地,待推送信息获取模块20包括信息模板获取单元21、用户信息获取单元22和待推送信息获取单元23。Preferably, the to-be-pushed information acquisition module 20 includes an information template acquisition unit 21, a user information acquisition unit 22, and a to-be-pushed information acquisition unit 23.
信息模板获取单元21,用于基于信息模板ID,获取信息模板。The information template obtaining unit 21 is configured to acquire an information template based on the information template ID.
用户信息获取单元22,用于基于信息模板ID,获取信息模板基于用户ID,获取与用户ID相对应的用户信息。The user information obtaining unit 22 is configured to acquire the user information corresponding to the user ID based on the user ID based on the information template ID.
待推送信息获取单元23,用于基于信息模板和用户信息,获取待推送信息。The to-be-push information acquiring unit 23 is configured to obtain information to be pushed based on the information template and the user information.
优选地,短链接获取模块30包括原始字节串获取单元31、目标字节串获取单元32、目标字符串获取单元33、八位十六进制数获取单元34、第一下标值获取单元35、第二下标值获取单元36和短链接获取单元37。Preferably, the short link acquisition module 30 includes a raw byte string acquisition unit 31, a target byte string acquisition unit 32, a target character string acquisition unit 33, an eight-digit hexadecimal number acquisition unit 34, and a first subscript value acquisition unit. 35. A second subscript value acquisition unit 36 and a short link acquisition unit 37.
原始字节串获取单元31,用于将长链接与预设关键值进行拼接,获取原始字节串。The original byte string obtaining unit 31 is configured to splicing the long link with the preset key value to obtain the original byte string.
目标字节串获取单元32,用于采用信息-摘要算法对原始字节串进行加密处理,获取目标字节串。The target byte string obtaining unit 32 is configured to perform encryption processing on the original byte string by using an information-digest algorithm to obtain a target byte string.
目标字符串获取单元33,用于对目标字节串进行字符型转换,获取目标字符串。 The target string obtaining unit 33 is configured to perform character conversion on the target byte string to obtain a target character string.
八位十六进制数获取单元34,用于对目标字符串按位划分,获取八位十六进制数。The eight-digit hexadecimal number obtaining unit 34 is configured to bit-divide the target character string to obtain an eight-digit hexadecimal number.
第一下标值获取单元35,用于将八位十六进制数与十六进制的第一预设值进行按位与运算,获取第一下标值。The first subscript value obtaining unit 35 is configured to perform bitwise AND operation on the eight-digit hexadecimal number and the first preset value in hexadecimal to obtain the first subscript value.
第二下标值获取单元36,用于将第一下标值与十六进制的第二预设值进行按位与运算,获取第二下标值。The second subscript value obtaining unit 36 is configured to perform a bitwise AND operation on the first subscript value and the second preset value in hexadecimal to obtain a second subscript value.
短链接获取单元37,用于从字符数组中获取与第二下标值相对应的字符,形成短链接。The short link obtaining unit 37 is configured to obtain a character corresponding to the second subscript value from the character array to form a short link.
优选地,网页内容发送模块70包括访问请求接受单元71、网页内容获取单元72和网页内容发送单元73。Preferably, the webpage content transmitting module 70 includes an access request accepting unit 71, a webpage content obtaining unit 72, and a webpage content transmitting unit 73.
访问请求接收单元71,用于接收客户端发送的访问请求,访问请求包括短链标识。The access request receiving unit 71 is configured to receive an access request sent by the client, where the access request includes a short-chain identifier.
网页内容获取单元72,用于基于短链标识查找对应的长链接,获取与长链接对应的网页内容。The webpage content obtaining unit 72 is configured to search for a corresponding long link based on the short-chain identifier, and obtain webpage content corresponding to the long link.
网页内容发送单元73,用于基于短链标识查找对应的长链接,获取与长链接对应的网页内容。The webpage content sending unit 73 is configured to search for a corresponding long link based on the short-chain identifier, and obtain webpage content corresponding to the long-link.
优选地,该信息推送装置还包括响应信息获取单元61、响应时间判断单元62和目标信息再发送单元63。Preferably, the information pushing apparatus further includes a response information acquiring unit 61, a response time judging unit 62, and a target information resending unit 63.
响应信息获取单元61,用于获取客户端发送的响应信息。The response information obtaining unit 61 is configured to obtain response information sent by the client.
响应时间判断单元62,判断接收响应信息的当前响应时间是否超过预设响应时间。The response time judging unit 62 judges whether or not the current response time of the reception response information exceeds the preset response time.
目标信息再发送单元63,用于当前响应时间超过预设响应时间,将目标推送信息重新发送给与用户ID相对应的客户端。The target information resending unit 63 is configured to resend the target push information to the client corresponding to the user ID, for the current response time exceeding the preset response time.
优选地,该信息推送装置还包括统计单元81和目标推送信息处理单元82。Preferably, the information pushing device further includes a statistic unit 81 and a target push information processing unit 82.
统计单元81,用于统计服务器缓存的目标推送信息的当前缓存时间和当前缓存数量。The statistic unit 81 is configured to count the current cache time and the current cache number of the target push information cached by the server.
目标推送信息处理单元82,用于在当前缓存时间超过预设缓存时间,和/或当前缓存数量超过预设缓存数量,删除目标推送信息。The target push information processing unit 82 is configured to delete the target push information when the current cache time exceeds the preset cache time, and/or the current cache number exceeds the preset cache amount.
实施例3Example 3
本实施例提供一计算机可读存储介质,该计算机可读存储介质上存储有计算机可读指令,该计算机可读指令被处理器执行时实现实施例1中信息推送方法,为避免重复,这里不再赘述。或者,该计算机可读指令被处理器执行时实现实施例2中信息推送装置的各模块/单元的功能,为避免重复,这里不再赘述。The embodiment provides a computer readable storage medium. The computer readable storage medium stores computer readable instructions. When the computer readable instructions are executed by the processor, the information pushing method in Embodiment 1 is implemented. Let me repeat. Alternatively, the functions of the modules/units of the information pushing apparatus in Embodiment 2 are implemented when the computer readable instructions are executed by the processor. To avoid repetition, details are not described herein again.
实施例4 Example 4
图8是本申请一实施例提供的终端设备的示意图。如图8所示,该实施例的终端设备100包括:处理器101、存储器102以及存储在存储器102中并可在处理器101上运行的计算机可读指令103。处理器101执行计算机可读指令103时实现上述各个信息推送方法实施例中的步骤,例如图1所示的步骤S10至S50。或者,处理器101执行计算机可读指令103时实现上述实施例2中信息推送装置的各模块/单元的功能。FIG. 8 is a schematic diagram of a terminal device according to an embodiment of the present application. As shown in FIG. 8, the terminal device 100 of this embodiment includes a processor 101, a memory 102, and computer readable instructions 103 stored in the memory 102 and executable on the processor 101. When the processor 101 executes the computer readable instructions 103, the steps in the above embodiments of the various information pushing methods are implemented, such as steps S10 to S50 shown in FIG. Alternatively, the processor 101 implements the functions of the modules/units of the information pushing apparatus in the second embodiment described above when the computer readable instructions 103 are executed.
示例性的,计算机可读指令103可以被分割成一个或多个模块/单元,一个或者多个模块/单元被存储在存储器102中,并由处理器101执行,以完成本申请。一个或多个模块/单元可以是能够完成特定功能的一系列计算机可读指令段,该指令段用于描述计算机可读指令103在终端设备100中的执行过程。例如,计算机可读指令103可以被分割成如图7所示的信息生成指令模块10、待推送信息获取模块20、短链接获取模块30、目标推送信息获取模块40、目标推送信息发送模块50、短链接标注模块90和网页内容发送模块70,各模块具体功能如实施例2所述,在此不一一赘述。Illustratively, computer readable instructions 103 may be partitioned into one or more modules/units, one or more modules/units being stored in memory 102 and executed by processor 101 to complete the application. The one or more modules/units may be a series of computer readable instruction segments capable of performing a particular function for describing the execution of computer readable instructions 103 in the terminal device 100. For example, the computer readable instruction 103 may be divided into an information generation instruction module 10, a to-be-pushed information acquisition module 20, a short link acquisition module 30, a target push information acquisition module 40, and a target push information transmission module 50, as shown in FIG. The short link labeling module 90 and the webpage content sending module 70, the specific functions of each module are as described in the second embodiment, and are not described herein.
终端设备100可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。终端设备可包括,但不仅限于,处理器101、存储器102。本领域技术人员可以理解,图8仅仅是终端设备100的示例,并不构成对终端设备100的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如终端设备还可以包括输入输出设备、网络接入设备、总线等。The terminal device 100 can be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server. The terminal device may include, but is not limited to, the processor 101 and the memory 102. It will be understood by those skilled in the art that FIG. 8 is only an example of the terminal device 100, and does not constitute a limitation of the terminal device 100, and may include more or less components than those illustrated, or combine some components or different components. For example, the terminal device may further include an input/output device, a network access device, a bus, and the like.
所称处理器101可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 101 may be a central processing unit (CPU), or may be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
存储器102可以是终端设备100的内部存储单元,例如终端设备100的硬盘或内存。存储器102也可以是终端设备100的外部存储设备,例如终端设备100上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器102还可以既包括终端设备100的内部存储单元也包括外部存储设备。存储器102用于存储计算机可读指令以及终端设备所需的其他程序和数据。存储器102还可以用于暂时地存储已经输出或者将要输出的数据。The memory 102 may be an internal storage unit of the terminal device 100, such as a hard disk or a memory of the terminal device 100. The memory 102 may also be an external storage device of the terminal device 100, such as a plug-in hard disk equipped on the terminal device 100, a smart memory card (SMC), a Secure Digital (SD) card, and a flash memory card (Flash). Card) and so on. Further, the memory 102 may also include both an internal storage unit of the terminal device 100 and an external storage device. The memory 102 is used to store computer readable instructions as well as other programs and data required by the terminal device. The memory 102 can also be used to temporarily store data that has been or will be output.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单 元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。It will be apparent to those skilled in the art that for the convenience and brevity of the description, only the above function lists are The division of the element and the module is exemplified. In the actual application, the function distribution may be completed by different functional units and modules according to requirements, that is, the internal structure of the device is divided into different functional units or modules to complete the above description. All or part of the function.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一计算机可读存储介质中,该计算机可读指令在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机可读指令包括计算机可读指令代码,所述计算机可读指令代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机可读指令代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括是电载波信号和电信信号。The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, the present application implements all or part of the processes in the foregoing embodiments, and may also be implemented by computer readable instructions, which may be stored in a computer readable storage medium. The computer readable instructions, when executed by a processor, may implement the steps of the various method embodiments described above. Wherein, the computer readable instructions comprise computer readable instruction code, which may be in the form of source code, an object code form, an executable file or some intermediate form or the like. The computer readable medium can include any entity or device capable of carrying the computer readable instruction code, a recording medium, a USB flash drive, a removable hard drive, a magnetic disk, an optical disk, a computer memory, a read only memory (ROM, Read-Only) Memory), random access memory (RAM), electrical carrier signals, telecommunications signals, and software distribution media. It should be noted that the content contained in the computer readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in a jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, computer readable media It does not include electrical carrier signals and telecommunication signals.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。 The above-mentioned embodiments are only used to explain the technical solutions of the present application, and are not limited thereto; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still implement the foregoing embodiments. The technical solutions described in the examples are modified or equivalently replaced with some of the technical features; and the modifications or substitutions do not deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in Within the scope of protection of this application.

Claims (20)

  1. 一种信息推送方法,其特征在于,包括:An information pushing method, comprising:
    获取信息生成指令,所述信息生成指令包括信息模板ID和用户ID;Obtaining an information generating instruction, where the information generating instruction includes an information template ID and a user ID;
    基于所述信息模板ID和所述用户ID,获取待推送信息,所述待推送信息包括长链接和信息内容;Obtaining to-be-push information based on the information template ID and the user ID, where the to-be-push information includes a long link and information content;
    采用长链转短链算法对所述长链接进行转化,获取短链接;Converting the long link by using a long chain to short chain algorithm to obtain a short link;
    基于所述短链接和所述信息内容,获取目标推送信息;Obtaining target push information based on the short link and the information content;
    将所述目标推送信息发送给与所述用户ID相对应的客户端。The target push information is sent to a client corresponding to the user ID.
  2. 如权利要求1所述的信息推送方法,其特征在于,所述基于所述信息模板ID和所述用户ID,获取待推送信息,包括:The information pushing method according to claim 1, wherein the obtaining the information to be pushed based on the information template ID and the user ID comprises:
    基于所述信息模板ID,获取信息模板;Obtaining an information template based on the information template ID;
    基于所述用户ID,获取与所述用户ID相对应的用户信息;Obtaining user information corresponding to the user ID based on the user ID;
    基于所述信息模板和所述用户信息,获取待推送信息。And obtaining information to be pushed based on the information template and the user information.
  3. 如权利要求1所述的信息推送方法,其特征在于,所述采用长链转短链算法对所述长链接进行转化,获取短链接,包括:The information pushing method according to claim 1, wherein the long chain to short chain algorithm is used to convert the long link to obtain a short link, including:
    将所述长链接与预设关键值进行拼接,获取原始字节串;Splicing the long link with a preset key value to obtain a raw byte string;
    采用信息-摘要算法对所述原始字节串进行加密处理,获取目标字节串;Encrypting the original byte string by using an information-summary algorithm to obtain a target byte string;
    对所述目标字节串进行字符型转换,获取目标字符串;Performing character conversion on the target byte string to obtain a target character string;
    对所述目标字符串按位划分,获取八位十六进制数;Dividing the target string bit by bit to obtain an eight-digit hexadecimal number;
    将所述八位十六进制数与十六进制的第一预设值进行按位与运算,获取第一下标值;Performing a bitwise AND operation on the eight-digit hexadecimal number and the first preset value in hexadecimal to obtain a first subscript value;
    将所述第一下标值与十六进制的第二预设值进行按位与运算,获取第二下标值;Performing bitwise AND operation on the first subscript value and the second preset value in hexadecimal to obtain a second subscript value;
    从预设字符数组中获取与所述第二下标值相对应的字符,形成所述短链接。The character corresponding to the second subscript value is obtained from a preset character array to form the short link.
  4. 如权利要求1所述的信息推送方法,其特征在于,所述采用长链转短链算法对所述长链接进行转化,获取短链接,之后还包括:对所述短链接进行标注,以使所述短链接携带短链标识;The information push method according to claim 1, wherein the long link to short chain algorithm is used to convert the long link to obtain a short link, and then the method further comprises: marking the short link to enable The short link carries a short chain identifier;
    所述将所述目标推送信息发送给与所述用户ID相对应的客户端,之后还包括:将与所述目标推送信息对应的网页内容发送到客户端;The sending the target push information to the client corresponding to the user ID, and further comprising: sending the webpage content corresponding to the target push information to the client;
    所述将与所述目标推送信息对应的网页内容发送到客户端,包括:Sending, to the client, the webpage content corresponding to the target push information, including:
    接收所述客户端发送的访问请求,所述访问请求包括所述短链标识; Receiving an access request sent by the client, where the access request includes the short-chain identifier;
    基于所述短链标识查找对应的长链接,获取与所述长链接对应的网页内容;Searching for a corresponding long link based on the short-chain identifier, and acquiring webpage content corresponding to the long link;
    将所述网页内容发送给所述客户端。Sending the webpage content to the client.
  5. 如权利要求1所述的信息推送方法,其特征在于,所述将所述目标推送信息发送给与所述用户ID相对应的客户端,之后还包括:The information pushing method according to claim 1, wherein the transmitting the target push information to the client corresponding to the user ID, and further comprising:
    获取所述客户端发送的响应信息;Obtaining response information sent by the client;
    判断接收所述响应信息的当前响应时间是否超过预设响应时间;Determining whether the current response time of receiving the response information exceeds a preset response time;
    若所述当前响应时间超过所述预设响应时间,则将所述目标推送信息重新发送给与所述用户ID相对应的客户端。If the current response time exceeds the preset response time, the target push information is resent to the client corresponding to the user ID.
  6. 如权利要求1所述的信息推送方法,其特征在于,所述信息推送方法还包括:The information pushing method according to claim 1, wherein the information pushing method further comprises:
    统计所述服务器缓存的目标推送信息的当前缓存时间和当前缓存数量;Counting a current cache time and a current cache amount of the target push information cached by the server;
    若所述当前缓存时间超过预设缓存时间,和/或所述当前缓存数量超过预设缓存数量,则删除所述目标推送信息。If the current cache time exceeds a preset cache time, and/or the current cache number exceeds a preset cache amount, the target push information is deleted.
  7. 一种信息推送装置,其特征在于,包括:An information pushing device, comprising:
    信息生成指令模块,用于获取信息生成指令,所述信息生成指令包括信息模板ID和用户ID;An information generating instruction module, configured to acquire an information generating instruction, where the information generating instruction includes an information template ID and a user ID;
    待推送信息获取模块,用于基于所述信息模板ID和所述用户ID,获取待推送信息,所述待推送信息包括长链接和信息内容;The to-be-push information acquisition module is configured to obtain information to be pushed based on the information template ID and the user ID, where the to-be-push information includes a long link and an information content;
    短链接获取模块,用于采用长链转短链算法对所述长链接进行转化,获取短链接;a short link obtaining module, configured to convert the long link by using a long chain to short chain algorithm to obtain a short link;
    目标推送信息获取模块,用于基于所述短链接和所述信息内容,获取目标推送信息;a target push information obtaining module, configured to acquire target push information based on the short link and the information content;
    目标推送信息发送模块,用于将所述目标推送信息发送给与所述用户ID相对应的客户端。The target push information sending module is configured to send the target push information to a client corresponding to the user ID.
  8. 如权利要求7所述的信息推送方法装置,其特征在于,还包括:The information push method apparatus according to claim 7, further comprising:
    统计单元,用于统计所述服务器缓存的目标推送信息的当前缓存时间和当前缓存数量;a statistical unit, configured to count a current cache time and a current cache quantity of the target push information cached by the server;
    目标推送信息处理单元,用于在所述当前缓存时间超过预设缓存时间,和/或当前缓存数量超过所述预设缓存数量,删除所述目标推送信息。The target push information processing unit is configured to delete the target push information when the current cache time exceeds a preset cache time, and/or the current cache number exceeds the preset cache amount.
  9. 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现如下步骤:A terminal device comprising a memory, a processor, and computer readable instructions stored in the memory and operable on the processor, wherein the processor executes the computer readable instructions as follows step:
    获取信息生成指令,所述信息生成指令包括信息模板ID和用户ID; Obtaining an information generating instruction, where the information generating instruction includes an information template ID and a user ID;
    基于所述信息模板ID和所述用户ID,获取待推送信息,所述待推送信息包括长链接和信息内容;Obtaining to-be-push information based on the information template ID and the user ID, where the to-be-push information includes a long link and information content;
    采用长链转短链算法对所述长链接进行转化,获取短链接;Converting the long link by using a long chain to short chain algorithm to obtain a short link;
    基于所述短链接和所述信息内容,获取目标推送信息;Obtaining target push information based on the short link and the information content;
    将所述目标推送信息发送给与所述用户ID相对应的客户端。The target push information is sent to a client corresponding to the user ID.
  10. 如权利要求9所述的终端设备,其特征在于,所述基于所述信息模板ID和所述用户ID,获取待推送信息,包括:The terminal device according to claim 9, wherein the obtaining the information to be pushed based on the information template ID and the user ID comprises:
    基于所述信息模板ID,获取信息模板;Obtaining an information template based on the information template ID;
    基于所述用户ID,获取与所述用户ID相对应的用户信息;Obtaining user information corresponding to the user ID based on the user ID;
    基于所述信息模板和所述用户信息,获取待推送信息。And obtaining information to be pushed based on the information template and the user information.
  11. 如权利要求9所述的终端设备,其特征在于,所述采用长链转短链算法对所述长链接进行转化,获取短链接,包括:The terminal device according to claim 9, wherein the long chain to short chain algorithm is used to convert the long link to obtain a short link, including:
    将所述长链接与预设关键值进行拼接,获取原始字节串;Splicing the long link with a preset key value to obtain a raw byte string;
    采用信息-摘要算法对所述原始字节串进行加密处理,获取目标字节串;Encrypting the original byte string by using an information-summary algorithm to obtain a target byte string;
    对所述目标字节串进行字符型转换,获取目标字符串;Performing character conversion on the target byte string to obtain a target character string;
    对所述目标字符串按位划分,获取八位十六进制数;Dividing the target string bit by bit to obtain an eight-digit hexadecimal number;
    将所述八位十六进制数与十六进制的第一预设值进行按位与运算,获取第一下标值;Performing a bitwise AND operation on the eight-digit hexadecimal number and the first preset value in hexadecimal to obtain a first subscript value;
    将所述第一下标值与十六进制的第二预设值进行按位与运算,获取第二下标值;Performing bitwise AND operation on the first subscript value and the second preset value in hexadecimal to obtain a second subscript value;
    从预设字符数组中获取与所述第二下标值相对应的字符,形成所述短链接。The character corresponding to the second subscript value is obtained from a preset character array to form the short link.
  12. 如权利要求9所述的终端设备,其特征在于,所述采用长链转短链算法对所述长链接进行转化,获取短链接,之后还包括:对所述短链接进行标注,以使所述短链接携带短链标识;The terminal device according to claim 9, wherein the long chain to short chain algorithm is used to convert the long link to obtain a short link, and further comprising: marking the short link to make the The short link carries a short chain identifier;
    所述将所述目标推送信息发送给与所述用户ID相对应的客户端,之后还包括:将与所述目标推送信息对应的网页内容发送到客户端;The sending the target push information to the client corresponding to the user ID, and further comprising: sending the webpage content corresponding to the target push information to the client;
    所述将与所述目标推送信息对应的网页内容发送到客户端,包括:Sending, to the client, the webpage content corresponding to the target push information, including:
    接收所述客户端发送的访问请求,所述访问请求包括所述短链标识;Receiving an access request sent by the client, where the access request includes the short-chain identifier;
    基于所述短链标识查找对应的长链接,获取与所述长链接对应的网页内容;Searching for a corresponding long link based on the short-chain identifier, and acquiring webpage content corresponding to the long link;
    将所述网页内容发送给所述客户端。Sending the webpage content to the client.
  13. 如权利要求9所述的终端设备,其特征在于,所述将所述目标推送信息发送给与所述用户ID相对应的客户端,之后还包括: The terminal device according to claim 9, wherein the transmitting the target push information to a client corresponding to the user ID, and further comprising:
    获取所述客户端发送的响应信息;Obtaining response information sent by the client;
    判断接收所述响应信息的当前响应时间是否超过预设响应时间;Determining whether the current response time of receiving the response information exceeds a preset response time;
    若所述当前响应时间超过所述预设响应时间,则将所述目标推送信息重新发送给与所述用户ID相对应的客户端。If the current response time exceeds the preset response time, the target push information is resent to the client corresponding to the user ID.
  14. 如权利要求9所述的终端设备,其特征在于,所述处理器执行所述计算机可读指令时还实现如下步骤:The terminal device according to claim 9, wherein said processor further implements the following steps when said computer readable instructions are executed:
    统计所述服务器缓存的目标推送信息的当前缓存时间和当前缓存数量;Counting a current cache time and a current cache amount of the target push information cached by the server;
    若所述当前缓存时间超过预设缓存时间,和/或所述当前缓存数量超过预设缓存数量,则删除所述目标推送信息。If the current cache time exceeds a preset cache time, and/or the current cache number exceeds a preset cache amount, the target push information is deleted.
  15. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现如下步骤:A computer readable storage medium storing computer readable instructions, wherein the computer readable instructions, when executed by a processor, implement the following steps:
    获取信息生成指令,所述信息生成指令包括信息模板ID和用户ID;Obtaining an information generating instruction, where the information generating instruction includes an information template ID and a user ID;
    基于所述信息模板ID和所述用户ID,获取待推送信息,所述待推送信息包括长链接和信息内容;Obtaining to-be-push information based on the information template ID and the user ID, where the to-be-push information includes a long link and information content;
    采用长链转短链算法对所述长链接进行转化,获取短链接;Converting the long link by using a long chain to short chain algorithm to obtain a short link;
    基于所述短链接和所述信息内容,获取目标推送信息;Obtaining target push information based on the short link and the information content;
    将所述目标推送信息发送给与所述用户ID相对应的客户端。The target push information is sent to a client corresponding to the user ID.
  16. 如权利要求15所述的计算机可读存储介质,其特征在于,所述基于所述信息模板ID和所述用户ID,获取待推送信息,包括:The computer readable storage medium according to claim 15, wherein the obtaining the information to be pushed based on the information template ID and the user ID comprises:
    基于所述信息模板ID,获取信息模板;Obtaining an information template based on the information template ID;
    基于所述用户ID,获取与所述用户ID相对应的用户信息;Obtaining user information corresponding to the user ID based on the user ID;
    基于所述信息模板和所述用户信息,获取待推送信息。And obtaining information to be pushed based on the information template and the user information.
  17. 如权利要求15所述的计算机可读存储介质,其特征在于,所述采用长链转短链算法对所述长链接进行转化,获取短链接,包括:The computer readable storage medium of claim 15, wherein the converting the long link by using a long chain to short chain algorithm to obtain a short link comprises:
    将所述长链接与预设关键值进行拼接,获取原始字节串;Splicing the long link with a preset key value to obtain a raw byte string;
    采用信息-摘要算法对所述原始字节串进行加密处理,获取目标字节串;Encrypting the original byte string by using an information-summary algorithm to obtain a target byte string;
    对所述目标字节串进行字符型转换,获取目标字符串;Performing character conversion on the target byte string to obtain a target character string;
    对所述目标字符串按位划分,获取八位十六进制数;Dividing the target string bit by bit to obtain an eight-digit hexadecimal number;
    将所述八位十六进制数与十六进制的第一预设值进行按位与运算,获取第一下标值;Performing a bitwise AND operation on the eight-digit hexadecimal number and the first preset value in hexadecimal to obtain a first subscript value;
    将所述第一下标值与十六进制的第二预设值进行按位与运算,获取第二下标值; Performing bitwise AND operation on the first subscript value and the second preset value in hexadecimal to obtain a second subscript value;
    从预设字符数组中获取与所述第二下标值相对应的字符,形成所述短链接。The character corresponding to the second subscript value is obtained from a preset character array to form the short link.
  18. 如权利要求15所述的计算机可读存储介质,其特征在于,所述采用长链转短链算法对所述长链接进行转化,获取短链接,之后还包括:对所述短链接进行标注,以使所述短链接携带短链标识;The computer readable storage medium according to claim 15, wherein the converting the long link by using a long chain to short chain algorithm to obtain a short link, further comprising: marking the short link, So that the short link carries a short chain identifier;
    所述将所述目标推送信息发送给与所述用户ID相对应的客户端,之后还包括:将与所述目标推送信息对应的网页内容发送到客户端;The sending the target push information to the client corresponding to the user ID, and further comprising: sending the webpage content corresponding to the target push information to the client;
    所述将与所述目标推送信息对应的网页内容发送到客户端,包括:Sending, to the client, the webpage content corresponding to the target push information, including:
    接收所述客户端发送的访问请求,所述访问请求包括所述短链标识;Receiving an access request sent by the client, where the access request includes the short-chain identifier;
    基于所述短链标识查找对应的长链接,获取与所述长链接对应的网页内容;Searching for a corresponding long link based on the short-chain identifier, and acquiring webpage content corresponding to the long link;
    将所述网页内容发送给所述客户端。Sending the webpage content to the client.
  19. 如权利要求15所述的计算机可读存储介质,其特征在于,所述将所述目标推送信息发送给与所述用户ID相对应的客户端,之后还包括:The computer readable storage medium according to claim 15, wherein the transmitting the target push information to a client corresponding to the user ID, further comprising:
    获取所述客户端发送的响应信息;Obtaining response information sent by the client;
    判断接收所述响应信息的当前响应时间是否超过预设响应时间;Determining whether the current response time of receiving the response information exceeds a preset response time;
    若所述当前响应时间超过所述预设响应时间,则将所述目标推送信息重新发送给与所述用户ID相对应的客户端。If the current response time exceeds the preset response time, the target push information is resent to the client corresponding to the user ID.
  20. 如权利要求15所述的计算机可读存储介质,其特征在于,所述计算机可读指令被处理器执行时还实现如下步骤:The computer readable storage medium of claim 15 wherein said computer readable instructions are further executed by the processor to:
    统计所述服务器缓存的目标推送信息的当前缓存时间和当前缓存数量;Counting a current cache time and a current cache amount of the target push information cached by the server;
    若所述当前缓存时间超过预设缓存时间,和/或所述当前缓存数量超过预设缓存数量,则删除所述目标推送信息。 If the current cache time exceeds a preset cache time, and/or the current cache number exceeds a preset cache amount, the target push information is deleted.
PCT/CN2017/112539 2017-11-16 2017-11-23 Information pushing method and apparatus, and terminal device and storage medium WO2019095416A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711134066.XA CN107749861A (en) 2017-11-16 2017-11-16 Information-pushing method, device, terminal device and storage medium
CN201711134066.X 2017-11-16

Publications (1)

Publication Number Publication Date
WO2019095416A1 true WO2019095416A1 (en) 2019-05-23

Family

ID=61251206

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/112539 WO2019095416A1 (en) 2017-11-16 2017-11-23 Information pushing method and apparatus, and terminal device and storage medium

Country Status (2)

Country Link
CN (1) CN107749861A (en)
WO (1) WO2019095416A1 (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110851748A (en) * 2019-10-14 2020-02-28 平安科技(深圳)有限公司 Short link generation method, server, storage medium and computer equipment
CN111047413A (en) * 2019-12-17 2020-04-21 秒针信息技术有限公司 Text content acquisition method and device, computer equipment and readable storage medium
CN112383584A (en) * 2020-10-12 2021-02-19 联通智网科技有限公司 Message pushing method, message display method and communication system
CN113157625A (en) * 2021-04-27 2021-07-23 百富计算机技术(深圳)有限公司 Data transmission method and device, terminal equipment and computer readable storage medium
CN113221009A (en) * 2021-05-26 2021-08-06 东莞市盟大塑化科技有限公司 Invitation code generation method, device, equipment and storage medium
CN113312127A (en) * 2021-05-13 2021-08-27 深圳市梦网云创科技有限公司 Information display method, device, server and medium
CN114640957A (en) * 2022-02-15 2022-06-17 深圳市梦网云创科技有限公司 Short message sending method, system, equipment and computer readable storage medium
CN114710556A (en) * 2022-06-08 2022-07-05 深圳市信润富联数字科技有限公司 Multi-system integrated message pushing method, device, equipment and storage medium
CN114915655A (en) * 2022-05-06 2022-08-16 广州市保伦电子有限公司 Information pushing method for filtering frequent operation and background server
CN113761406B (en) * 2021-09-03 2024-06-04 丰巢网络技术有限公司 Intelligent cabinet two-dimension code short-chain generation method and device, medium and electronic equipment

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108427751A (en) * 2018-03-13 2018-08-21 深圳乐信软件技术有限公司 A kind of short chain connects jump method, device and electronic equipment
CN110580633B (en) * 2018-06-08 2021-03-02 北京三快在线科技有限公司 Information pushing method and device and server
CN109347898B (en) * 2018-08-20 2021-04-30 深圳市梦网科技发展有限公司 Scene information sending method, scene information display method, server and mobile terminal
CN109255075A (en) * 2018-09-07 2019-01-22 精硕科技(北京)股份有限公司 Movable method for pushing, device, equipment and computer readable storage medium
CN109302473A (en) * 2018-09-28 2019-02-01 重庆赢者科技有限公司 A kind of voice SMS transmission system and method
EP3962023A4 (en) * 2018-12-04 2022-04-27 Hong Kong Sunstar Technology Co., Limited Method and device for transmitting list information
CN109634683B (en) * 2018-12-05 2021-12-28 珠海市小源科技有限公司 Short message operation framework configuration and pushing method and device based on enterprise expectation
CN109871496A (en) * 2019-01-30 2019-06-11 重庆神指奇动网络有限公司 A kind of information-pushing method, information display method, server and display equipment
CN110134889B (en) * 2019-04-30 2021-08-10 中国联合网络通信集团有限公司 Short link generation method and device and server
CN110191178A (en) * 2019-05-29 2019-08-30 深圳市梦网科技发展有限公司 A kind of message push system and information push method, terminal device
CN110247963A (en) * 2019-05-31 2019-09-17 北京智慧云行科技有限责任公司 A kind of data push method and system
CN110442805A (en) * 2019-07-05 2019-11-12 深圳壹账通智能科技有限公司 Data entry method, system, equipment and storage medium
CN110662184A (en) * 2019-08-15 2020-01-07 中国平安财产保险股份有限公司 Information pushing method and device, computer equipment and storage medium
WO2021072664A1 (en) * 2019-10-16 2021-04-22 深圳市欢太科技有限公司 Information obtaining method and apparatus, system, electronic device, and storage medium
CN113496111A (en) * 2020-04-03 2021-10-12 华为技术有限公司 Character string processing method and device
CN112035763A (en) * 2020-09-01 2020-12-04 中国银行股份有限公司 Information processing method, device and system, electronic equipment and storage medium
CN113420238A (en) * 2021-06-18 2021-09-21 浙江集享电子商务有限公司 Short link generation method, device, electronic device and storage medium
CN113435165A (en) * 2021-06-23 2021-09-24 未鲲(上海)科技服务有限公司 Data processing method, device, server and storage medium
CN113554315A (en) * 2021-07-26 2021-10-26 平安消费金融有限公司 Service data tracking method and device, computer equipment and storage medium
CN114520741B (en) * 2022-02-16 2023-07-14 平安科技(深圳)有限公司 Information pushing method, related equipment and system
CN115065721B (en) * 2022-04-21 2024-06-21 北京达佳互联信息技术有限公司 Message processing method, device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105740357A (en) * 2016-01-26 2016-07-06 北京维思智达科技有限公司 Method and device for providing information
US20160248837A1 (en) * 2013-10-30 2016-08-25 Tencent Technology (Shenzhen) Company Limited Methods and apparatus for realizing short url service
CN107135283A (en) * 2017-04-17 2017-09-05 南京欣网互联信息技术有限公司 A kind of Chief Web Officer short chain configuring management method

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101674374A (en) * 2009-09-02 2010-03-17 优视动景(北京)技术服务有限公司 Webpage content extraction forwarding system for mobile communication terminal and application method thereof
US8381276B2 (en) * 2010-08-23 2013-02-19 Microsoft Corporation Safe URL shortening
US8499099B1 (en) * 2011-03-29 2013-07-30 Google Inc. Converting data into addresses
CN102810089B (en) * 2011-05-30 2017-07-04 盛乐信息技术(上海)有限公司 Short link system and implementation method based on content
CN104080059A (en) * 2013-03-25 2014-10-01 中国移动通信集团福建有限公司 Method, device and system of implementing short message sending and receiving
CN105306383B (en) * 2014-06-10 2019-11-19 腾讯科技(深圳)有限公司 The method for pushing and terminal and push server of a kind of message
CN105933369B (en) * 2015-12-24 2019-05-10 中国银联股份有限公司 A kind of message forwarding method and equipment
CN106933854B (en) * 2015-12-30 2020-06-30 阿里巴巴集团控股有限公司 Short link processing method and device and server
US10447686B2 (en) * 2016-04-25 2019-10-15 Dice Corporation Authenticated and functional SMS links
CN106210161A (en) * 2016-06-24 2016-12-07 中国银联股份有限公司 A kind of short chain delivers a child into method and system
CN106375189A (en) * 2016-08-31 2017-02-01 北京炎黄新星网络科技有限公司 Long and short link switching method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160248837A1 (en) * 2013-10-30 2016-08-25 Tencent Technology (Shenzhen) Company Limited Methods and apparatus for realizing short url service
CN105740357A (en) * 2016-01-26 2016-07-06 北京维思智达科技有限公司 Method and device for providing information
CN107135283A (en) * 2017-04-17 2017-09-05 南京欣网互联信息技术有限公司 A kind of Chief Web Officer short chain configuring management method

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110851748A (en) * 2019-10-14 2020-02-28 平安科技(深圳)有限公司 Short link generation method, server, storage medium and computer equipment
CN111047413B (en) * 2019-12-17 2023-11-07 秒针信息技术有限公司 Method, device, computer equipment and readable storage medium for acquiring text content
CN111047413A (en) * 2019-12-17 2020-04-21 秒针信息技术有限公司 Text content acquisition method and device, computer equipment and readable storage medium
CN112383584A (en) * 2020-10-12 2021-02-19 联通智网科技有限公司 Message pushing method, message display method and communication system
CN113157625A (en) * 2021-04-27 2021-07-23 百富计算机技术(深圳)有限公司 Data transmission method and device, terminal equipment and computer readable storage medium
CN113157625B (en) * 2021-04-27 2023-12-19 百富计算机技术(深圳)有限公司 Data transmission method, device, terminal equipment and computer readable storage medium
CN113312127A (en) * 2021-05-13 2021-08-27 深圳市梦网云创科技有限公司 Information display method, device, server and medium
CN113221009A (en) * 2021-05-26 2021-08-06 东莞市盟大塑化科技有限公司 Invitation code generation method, device, equipment and storage medium
CN113761406B (en) * 2021-09-03 2024-06-04 丰巢网络技术有限公司 Intelligent cabinet two-dimension code short-chain generation method and device, medium and electronic equipment
CN114640957A (en) * 2022-02-15 2022-06-17 深圳市梦网云创科技有限公司 Short message sending method, system, equipment and computer readable storage medium
CN114640957B (en) * 2022-02-15 2024-03-19 深圳市梦网云创科技有限公司 Short message sending method, system, equipment and computer readable storage medium
CN114915655A (en) * 2022-05-06 2022-08-16 广州市保伦电子有限公司 Information pushing method for filtering frequent operation and background server
CN114915655B (en) * 2022-05-06 2024-02-09 广东保伦电子股份有限公司 Information pushing method for filtering frequent operation and background server
CN114710556B (en) * 2022-06-08 2022-09-16 深圳市信润富联数字科技有限公司 Multi-system integrated message pushing method, device, equipment and storage medium
CN114710556A (en) * 2022-06-08 2022-07-05 深圳市信润富联数字科技有限公司 Multi-system integrated message pushing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN107749861A (en) 2018-03-02

Similar Documents

Publication Publication Date Title
WO2019095416A1 (en) Information pushing method and apparatus, and terminal device and storage medium
US10614135B2 (en) Wildcard search in encrypted text using order preserving encryption
US10013574B2 (en) Method and apparatus for secure storage and retrieval of encrypted files in public cloud-computing platforms
CN107947918B (en) Carrier-free text steganography method based on character features
CN109858263B (en) Data storage and retrieval method and device, electronic equipment and storage medium
CN109189857B (en) Data sharing system, method and device based on block chain
US9197613B2 (en) Document processing method and system
US10536439B2 (en) Client fingerprinting for information system security
CN102915363B (en) Web site collection method and system
US20130159695A1 (en) Document processing method and system
US10298401B1 (en) Network content search system and method
US10615965B1 (en) Protected search index
WO2020199603A1 (en) Server vulnerability detection method and apparatus, device, and storage medium
CN105827582A (en) Communication encryption method, device and system
CN113094334B (en) Digital service method, device, equipment and storage medium based on distributed storage
CN111563109A (en) Radix statistics method, apparatus, system, device and computer readable storage medium
CN108304733A (en) Encryption data searching method and the data-storage system that search can be encrypted
CN113505318A (en) Short link generation method, device, equipment and storage medium
CN107979595B (en) Private data protection method and gateway system
CN110222520A (en) The keyword query method of figure encryption data is supported in cloud environment
CN109343971B (en) Browser data transmission method and device based on cache technology
US11003783B1 (en) Searchable encrypted data stores
CN115757545A (en) Ciphertext retrieval method, ciphertext storage method, ciphertext retrieval device, electronic equipment and ciphertext storage medium
CN114039801B (en) Short link generation method, short link analysis system, short link analysis equipment and storage medium
CN102937982B (en) A kind of method and system collecting content generation

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17931934

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 13/08/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 17931934

Country of ref document: EP

Kind code of ref document: A1