A method, device, equipment and storage medium for generating business short messages
By using blockchain devices to match business tags and templates in the method of generating business text messages, the problem of low compatibility between business text messages in the prior art is solved, and efficient business text messages are achieved.
Patent Information
- Application Number
- CN202110945210.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-17
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-08-17
AI Technical Summary
In the existing methods of generating business SMS, the content of the business SMS generated by the server is low in compliance with the business and needs manual modification.
By obtaining pending information from the business system, including business information and user's business tags, the service tag is sent to the blockchain device to match the template. The blockchain device determines the matching template based on the stored corresponding relationship information, and the terminal device uses the service based on the service. Information and templates generate business text messages.
It improves the compatibility between the content of business text messages and the business, reduces the need for manual review and modification, and improves the transmission efficiency.
Smart Images

Figure CN115842796B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of communication technology, and in particular, relates to a method, device, equipment and storage medium for generating business text messages. Background Art
[0002] As network technology matures, sending business text messages has become an important way for various websites, applications and users to communicate. Business text messages refer to text messages related to the business of various websites and applications.
[0003] The server generates business SMS messages for various websites and applications based on templates. These often do not meet business requirements and need to be modified manually.
[0004] In the existing method for generating business short messages, the content of the business short messages generated by the server is not highly relevant to the business. Summary of the invention
[0005] The embodiments of the present application provide a method, apparatus, device and storage medium for generating a business SMS, which can improve the relevance of the content of the generated business SMS to the business.
[0006] In a first aspect, an embodiment of the present application provides a method for generating a service SMS, the method comprising:
[0007] Acquire information to be processed from the service system, where the information to be processed includes service information and a service tag of the first called user;
[0008] Sending the service tag of the first called user to the blockchain device, so that the blockchain device determines a template matching the service tag of the first called user according to the correspondence information between the service tags and the templates stored in the blockchain device, where the service tags in the correspondence information include the service tag of the first called user;
[0009] Receive the template sent by the blockchain device;
[0010] Generate business SMS based on business information and templates.
[0011] In a possible implementation, before obtaining the information to be processed from the business system, the method further includes:
[0012] Acquire service tags of multiple second called users and service text messages of the second called users within a preset time period, where the second called users include the first called user;
[0013] Determine a third user whose number of service tags among the second users is less than a preset threshold;
[0014] Determine the service text messages of the third user within a preset time period as samples; generate a template corresponding to the service tag corresponding to the sample;
[0015] According to the business tag corresponding to the sample and the template corresponding to the business tag corresponding to the sample, correspondence relationship information between the business tag corresponding to the sample and the template corresponding to the business tag corresponding to the sample is generated.
[0016] In a possible implementation, the method further includes:
[0017] The template and the corresponding relationship information are sent to the blockchain device so that the blockchain device receives and stores the template and the corresponding relationship information.
[0018] In a possible implementation, sending the template and the corresponding relationship information to the blockchain device includes:
[0019] Get the encryption key from the key generation module;
[0020] Through the smart contract module, the encryption key, template and corresponding relationship information are sent to the blockchain device.
[0021] In a possible implementation, receiving a template sent by a blockchain device includes:
[0022] Obtain the decryption key generated by the business system; when the blockchain device successfully verifies the business system based on the encryption key and the decryption key, receive the template sent by the blockchain device that matches the business tag of the first called user.
[0023] In a possible implementation, the blockchain device further includes a preset weight of each service tag. Before sending the service tag of the first called user to the blockchain device, the method further includes:
[0024] Generate a first SMS sending task according to the information to be processed;
[0025] Obtaining a preset weight of the service tag of the first called user from the blockchain device;
[0026] Calculate the priority of the first SMS sending task according to the service tag and preset weight of the first called user;
[0027] According to the priority of the first SMS sending task, the first SMS sending task is inserted into a queue corresponding to the priority.
[0028] In a possible implementation, the method further includes:
[0029] Obtaining a preset length and a preset adjustment threshold of each queue, and the number of second SMS sending tasks in each queue, where the second SMS sending tasks include the first SMS sending tasks;
[0030] Calculate the unoccupied length of each queue according to the preset length and the number of the second SMS sending tasks;
[0031] When the unoccupied length is less than a preset adjustment threshold, the preset length of the queue is adjusted according to the preset length and the number of second SMS sending tasks.
[0032] In a possible implementation, the method further includes:
[0033] Detect the slack of each second SMS sending task;
[0034] According to the slack, adjust the priority of the second SMS sending task;
[0035] According to the adjusted priority, the second SMS sending task is inserted into the queue corresponding to the adjusted priority.
[0036] In a possible implementation, sending the service tag of the first called user to the blockchain device includes:
[0037] When the queue executes the first SMS sending task, the service tag of the first called user is sent to the blockchain device.
[0038] In a second aspect, an embodiment of the present application provides a method for generating a service SMS, which is applied to a blockchain device, wherein the blockchain device includes a template, and correspondence information between a service tag and the template, wherein the service tag in the correspondence information includes a service tag of a first called user;
[0039] The method includes:
[0040] receiving a service label of a first called user;
[0041] Determining, according to the corresponding relationship information, a template matching the service label of the first called user;
[0042] Send the template to the terminal device.
[0043] In a third aspect, an embodiment of the present application provides a device for generating a business SMS, the device comprising:
[0044] An acquisition module, used for acquiring information to be processed from a business system, where the information to be processed includes business information and a business tag of the first called user;
[0045] A sending module, configured to send the service tag of the first called user to the blockchain device, so that the blockchain device determines a template matching the service tag of the first called user according to the correspondence information between the service tag and the template stored in the blockchain device, wherein the service tag in the correspondence information includes the service tag of the first called user;
[0046] A receiving module, used to receive the template sent by the blockchain device;
[0047] The generation module is used to generate business SMS based on business information and templates.
[0048] In a fourth aspect, an embodiment of the present application provides a device for generating a service SMS, wherein the device includes a template, and correspondence information between a service tag and the template, wherein the service tag in the correspondence information includes a service tag of a first called user;
[0049] The device includes:
[0050] A receiving module, used for receiving a service label of a first called user;
[0051] A determination module, used to determine a template matching the service label of the first called user according to the corresponding relationship information;
[0052] The sending module is used to send the template to the terminal device.
[0053] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the method in the first aspect or any possible implementation of the first aspect, and implements the method in the second aspect or any possible implementation of the second aspect.
[0054] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the method in the first aspect or any possible implementation of the first aspect, and implement the method in the second aspect or any possible implementation of the second aspect.
[0055] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:
[0056] The terminal device in the embodiment of the present application obtains information to be processed from the business system, where the information to be processed includes business information and a business tag of the first called user, and sends the business tag of the first called user to the blockchain device. The blockchain device determines a template that matches the business tag of the first called user based on the correspondence information between the business tag and the template stored in the blockchain device. The business tag represents the business characteristics of the first called user, so the template that matches the business tag of the first called user fits the business characteristics of the first called user. The terminal device receives the template sent by the blockchain device, and then generates a business SMS based on the business information and the template. Since the template fits the business characteristics of the first called user, and the business SMS is generated based on the business information and the template, the content of the business SMS is highly consistent with the business, thereby improving the consistency between the content of the business SMS and the business. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0058] Figure 1 This is a flow chart of a method for generating a business SMS provided in an embodiment of the present application;
[0059] Figure 2 This is a flowchart of another method for generating a business SMS provided in an embodiment of the present application;
[0060] Figure 3 It is a schematic diagram of the structure of a device for generating a business SMS provided in an embodiment of the present application;
[0061] Figure 4 It is a schematic diagram of the structure of another device for generating business SMS provided in an embodiment of the present application;
[0062] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only configured to explain the present application and are not configured to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0064] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0065] As network technology matures, sending business text messages has become an important way for various websites, applications and users to communicate. Business text messages refer to text messages related to the business of various websites and applications.
[0066] The server generates business SMS messages for various websites and applications based on templates. These often do not meet business requirements and need to be modified manually.
[0067] In the existing method for generating business short messages, the content of the business short messages generated by the server is not highly relevant to the business.
[0068] The embodiments of the present application provide a method, apparatus, device and storage medium for generating a business SMS, which can improve the relevance of the content of the generated business SMS to the business.
[0069] First, an embodiment of the present application provides a terminal device for generating business SMS, which may include a pre-processing center module, a SMS processing center module and a scheduling service center module.
[0070] Among them, the pre-processing center module is used to obtain the business tags of multiple second called users and the business text messages of the second called users within a preset time period, and the second called users include the first called user; it is also used to determine a third user whose number of business tags among the second users is less than a preset threshold; it is also used to determine the business text messages of the third user within the preset time period as a sample; it is also used to generate a template corresponding to the business tag corresponding to the sample; it is also used to generate the correspondence information between the business tag corresponding to the sample and the template corresponding to the business tag corresponding to the sample according to the business tag corresponding to the sample and the template corresponding to the business tag corresponding to the sample, and send the business tag, template, and the correspondence between the business tag and the template to the blockchain device.
[0071] The SMS processing center module is used to generate a first SMS sending task according to the information to be processed and send it to the scheduling service center module.
[0072] The scheduling service center module is used to send the service tag of the first called user to the blockchain device, receive the template sent by the blockchain and the preset weight corresponding to the service tag, calculate the priority of the first SMS sending task according to the preset weight corresponding to the service tag, and generate a service SMS according to the template and the service tag when executing the first SMS sending task.
[0073] Then, the embodiment of the present application also provides a blockchain device for receiving and storing templates, business tags, correspondences between templates and business tags, preset weights of business tags, and matching templates according to business tags sent by terminal devices.
[0074] The execution subject of the method provided in the embodiment of the present application can be a terminal device with data receiving, data sending and data processing capabilities, such as a computer, a server, etc. The terminal device may include a pre-processing center module, a short message processing center module and a scheduling service center module.
[0075] The following will be combined Figure 1 A method for generating business SMS provided by an embodiment of the present application is described in detail.
[0076] like Figure 1 As shown, the method may include the following steps:
[0077] S110, obtaining information to be processed from a service system, where the information to be processed includes service information and a service tag of the first called user.
[0078] A business system may be a system for editing text messages for various websites or applications.
[0079] The business information may be information related to the business, for example, the business information may include the content of a text message.
[0080] The first called user is the user who receives the service SMS.
[0081] The service label of the first called user represents the service characteristics of the first called user and may include at least one of the following labels:
[0082] The city information of the user number, the district and county information of the user number, the mobile terminal model, the average monthly revenue per user (ARPU) in the past three months, the name of the tariff package, the voice call saturation value within the package for the current month, family information, government and enterprise attribute information, and user complaint information.
[0083] The family information may include at least one of the following tags:
[0084] Whether the user is a broadband user, broadband name, broadband activation time, broadband expiration time, etc.
[0085] In an example, the service tag of the first called user includes: the city information of the user number is Province A, City B, the district and county information of the user number is District C, and the average monthly ARPU in the past three months is 100. When a website needs to verify the first called user through a verification code SMS, the SMS processing center module obtains the business information of the website (ie, the verification code) and the service tag of the first called user from the business system.
[0086] S120: Send the service tag of the first called user to the blockchain device.
[0087] In some embodiments, the template, service tag and the correspondence between the templates stored in the blockchain device, the service tag in the correspondence information includes the service tag of the first called user.
[0088] The dispatch center module sends the service tag of the first called user to the blockchain device. After receiving the service tag sent by the dispatch center module, the blockchain device determines the template that matches the service tag of the first called user according to the correspondence information between the service tag and the template stored in the blockchain device, and sends the template that matches the service tag of the first called user to the dispatch center module.
[0089] Storing the template, business label and the correspondence information of the template in the blockchain device can prevent the template and the correspondence from being tampered with, ensuring the security and accuracy of the template and the correspondence information.
[0090] S130, receiving a template sent by a blockchain device.
[0091] The dispatch center module receives the template sent by the blockchain device.
[0092] The template corresponds to the business label and provides a basis for generating business SMS that is relevant to the business.
[0093] S140, generating a business SMS according to the business information and the template.
[0094] The dispatch center module generates a business SMS of the first called user by splicing the business information and the template according to the business information and the template.
[0095] Since the template fits the business characteristics of the first called user, the business information is information related to the business, and the business SMS is generated based on the business information and the template, the content of the business SMS is highly relevant to the business, does not require manual review, and can be sent directly to the first called user, thereby improving the efficiency of sending business SMS.
[0096] In an embodiment of the present application, a terminal device obtains information to be processed from a business system, where the information to be processed includes business information and a business tag of a first called user, and sends the business tag of the first called user to a blockchain device. The blockchain device determines a template that matches the business tag of the first called user based on the correspondence information between the business tag and the template stored in the blockchain device. The business tag represents the business characteristics of the first called user, so the template that matches the business tag of the first called user fits the business characteristics of the first called user. The terminal device receives the template sent by the blockchain device, and then generates a business SMS based on the business information and the template. Since the template fits the business characteristics of the first called user, the business information is information related to the business, and the business SMS is generated based on the business information and the template, the content of the business SMS has a high degree of fit with the business, thereby improving the fit between the content of the business SMS and the business.
[0097] In some embodiments, before step S110, the method for generating a service SMS further includes:
[0098] Obtain business tags of multiple second called users and business text messages of the second called users within a preset time period, wherein the second called users include the first called user; determine a third user whose number of business tags among the second users is less than a preset threshold; determine the business text messages of the third user within the preset time period as a sample; generate a template corresponding to the business tag corresponding to the sample; and generate correspondence information between the business tag corresponding to the sample and the template corresponding to the business tag corresponding to the sample based on the business tag corresponding to the sample and the template corresponding to the business tag corresponding to the sample.
[0099] The preset time period is determined by the technician based on actual conditions, for example, it can be the past month.
[0100] The preset threshold is determined by the technician according to the actual situation. For example, the preset threshold can be 2 or 3.
[0101] In some embodiments, the pre-processing center module obtains business tags of multiple second called users and business text messages of the second called users in the past period of time, each second called user has one or more business tags, and determines the second called user whose number of business tags is less than a preset threshold as a third called user, and determines the business text messages of the third user in the preset time period as a sample; generates a template corresponding to the business tag corresponding to the sample, and generates correspondence information between the business tag corresponding to the sample and the template corresponding to the business tag corresponding to the sample based on the business tag corresponding to the sample and the template corresponding to the business tag corresponding to the sample.
[0102] In one example, the pre-processing center module obtains service tags of multiple second called users and service text messages of the second called users in the past month. Each second called user has one or more service tags. The second called user whose number of service tags is less than 2 (i.e., the number of service tags is 1) is determined as the third called user. T service text messages of the third user in the past month are determined as samples. The service tags of all second called users are counted to obtain the total number N of service tag types, and each service tag corresponds to a different numerical value.
[0103] Wherein, T is an integer greater than 0, and N is an integer greater than 0.
[0104] For each sample, perform the following steps:
[0105] S1, randomly select a sample p from T samples, calculate k neighboring samples whose numerical similarity with sample p meets the requirements from T samples, and randomly select a sample q from the k neighboring samples;
[0106] S2, according to the value of each service label corresponding to the sample q and the sample p, the sample set P is calculated using formula (1).
[0107] P=p+rand(0,1)×(qp) Formula (1)
[0108] S3, calculate the template TP corresponding to one service label corresponding to the sample p according to formula (ii).
[0109] TP=T∪P Formula (II)
[0110] After the above steps, a template corresponding to the business label corresponding to each sample in the T samples is obtained.
[0111] According to the business tag corresponding to the sample and the template corresponding to the business tag corresponding to the sample, correspondence relationship information between the business tag corresponding to the sample and the template corresponding to the business tag corresponding to the sample is generated.
[0112] The method provided in the embodiment of the present application generates correspondence information between a service tag and a template, and provides a basis for determining a template corresponding to a service tag according to the correspondence information.
[0113] In some embodiments, the method for generating a service SMS also includes:
[0114] The template and the corresponding relationship information are sent to the blockchain device, and the blockchain device receives and stores the template and the corresponding relationship information.
[0115] In the embodiment of the present application, the template, business label and the correspondence information of the template are stored in the blockchain device, which can prevent the template and the correspondence from being tampered with, and ensure the security and accuracy of the template and the correspondence information.
[0116] In some embodiments, sending the template and the corresponding relationship information to the blockchain device includes:
[0117] Obtain the encryption key from the key generation module; send the encryption key, template and corresponding relationship information to the blockchain device through the smart contract module.
[0118] In one example, the template and the corresponding relationship information are set as a data set DataSet, a key pair (k1, k2) is randomly generated by a key generator, and the symmetric key is calculated. The data set (k1, DataSet) is uploaded to the blockchain device through the smart contract module, and the blockchain is stored in the blockchain device; the key center of the blockchain device is initialized, including hiding the security parameter λ, generating the public key PK, the master key MK, etc., and the ciphertext EK is generated by PK and stored in each node of the blockchain.
[0119] In the embodiment of the present application, the template, business label and the correspondence information of the template and the secret key are stored in the blockchain device, which can prevent the template and the correspondence from being tampered with, and ensure the security and accuracy of the template and the correspondence information.
[0120] In some embodiments, step S130, receiving a template sent by a blockchain device, includes:
[0121] Obtain the decryption key generated by the business system; when the blockchain device successfully verifies the business system based on the encryption key and the decryption key, receive the template sent by the blockchain device that matches the business tag of the first called user.
[0122] The business system generates a decryption key based on the business tag of the first called user. The SMS processing center module sends the decryption key to the blockchain device. The blockchain device verifies the business system based on the encryption key and the decryption key. When the verification is successful, the blockchain device sends the template matching the business tag of the first called user to the scheduling service center module.
[0123] In one example, the blockchain device calculates the decryption function based on the public key PK, the master key MK and the business tag to generate the decryption key k′2. and If the values are equal, it means that the business system is a compliant user and has the authority to the data.
[0124] Among them, the blockchain device calculates the decryption function based on the public key PK, the master key MK and the business label to generate the decryption key k′2, including: calculating the decryption function DK according to the formula KenGen(MK, PK, DataPart), and generating the decryption key k′2 according to the formula Decrypt(PK, DK, EK).
[0125] In the embodiment of the present application, the service system generates a decryption key according to the service tag of the first called user, and the terminal device sends the decryption key to the blockchain device. The blockchain device verifies the service system according to the encryption key and the decryption key. When the verification is successful, the blockchain device sends the template matching the service tag of the first called user to the terminal device. The service system is verified by the key pair of the blockchain, and the template is matched for the service tag of the first called user only when the verification is successful. This ensures that the template and the corresponding relationship are not accessed by illegal service systems, and ensures the security of the information template and the corresponding relationship.
[0126] In some embodiments, the blockchain device further includes a preset weight of each service tag. Before sending the service tag of the first called user to the blockchain device, the method further includes:
[0127] Generate a first SMS sending task according to the information to be processed; obtain the preset weight of the service tag of the first called user from the blockchain device; calculate the priority of the first SMS sending task according to the service tag and the preset weight of the first called user; and insert the first SMS sending task into a queue corresponding to the priority according to the priority of the first SMS sending task.
[0128] The business system sends the information to be processed to the SMS processing center module, and the SMS processing center module generates a first SMS sending task according to the information to be processed.
[0129] In one example, the SMS processing center module converts the information to be processed into a unified data instruction format as the first SMS sending task, and the data instructions are shown in the following table.
[0130]
[0131] In one example, the set of n service tags included in the first SMS sending task is F(f1,…f n ), where n is an integer greater than 0, the SMS dispatch service center module obtains the preset weight Q (q1, ...q n ), where q1 represents the preset weight of the service label f1, and qn represents the preset weight of the service label fn.
[0132] In one example, the SMS processing center module calculates the priority of the first SMS sending task according to the service tag and preset weight of the first called user.
[0133] The priority of the first task of sending a text message IDF(F, P)=|F*Q|*α, where α is an adjustment factor, and the priority of the first task of sending a text message is adjusted according to actual conditions.
[0134] In one example, the SMS dispatch service center module pre-sets multiple queues, where one queue corresponds to a priority range, or each queue corresponds to a priority.
[0135] For example, three queues are set, corresponding to high, medium and low priorities respectively. The first SMS sending task with a priority of 1-3 is a low priority, the first SMS sending task with a priority of 3-5 is a medium priority, and the first SMS sending task with a priority of 5-7 is a high priority.
[0136] Or set up 10 queues, each priority corresponds to a queue, and the higher the priority, the higher the priority of the queue corresponding to the first SMS sending task.
[0137] The SMS dispatch service center module inserts the first SMS sending task into a queue corresponding to the priority according to the priority of the first SMS sending task.
[0138] In some embodiments, the method for generating a service SMS also includes:
[0139] Obtain the preset length and preset adjustment threshold of each queue, as well as the number of second SMS sending tasks in each queue, where the second SMS sending tasks include the first SMS sending tasks; calculate the unoccupied length of each queue based on the preset length and the number of second SMS sending tasks; when the unoccupied length is less than the preset adjustment threshold, adjust the preset length of the queue based on the preset length and the number of second SMS sending tasks.
[0140] The SMS dispatch service center module obtains the preset length of each queue Qc and preset adjustment threshold, and the number z of the second SMS sending tasks in each queue, according to the preset length Qc And the number of second SMS sending tasks z, calculate the unoccupied length Q of each queue u , when the unoccupied length Q u When it is less than the preset adjustment threshold, the preset length Q of the queue is adjusted according to the preset length and the number of the second SMS sending tasks. c .
[0141] In one example, the real-time length of each queue is Q i , the dynamic length of each queue is Where Qi Indicates the real-time length of the queue with priority i, Indicates the dynamic length of the queue with priority i, m represents the total number of queues, m is an integer greater than 0, i is an integer greater than 0, and i is less than or equal to m.
[0142] The probability that there are z tasks in the queue with priority i is P{X=i}. If the prediction weight coefficient μ is set, P{X=i} is calculated according to formula (III).
[0143] P{X=i}=μ*P{X=i,Y=1}+μ(1-μ)*P{X=i,Y=2}+…+(1-μ) z-2 *P{X=i,Y=z-1}+μ(1-μ)z-1*P{X=i,Y=z} Formula (3)
[0144] Among them, Y represents the Yth task in the queue.
[0145] According to formula (IV), the probability that there are z tasks in the queue with priority i at time j is P(X=i, Y=j).
[0146] P(X=i,Y=j)=B ij / B j Formula (IV)
[0147] Among them, B ij At time j, the priority is the amount of data in queue i, B j It is the amount of data in the total data flow.
[0148] After inserting the first SMS sending task into the queue, the unoccupied length Q of each queue is calculated according to formula (V): u .
[0149] Q u =Q i -Q yi Formula (V)
[0150] Among them, Q yi is the queue length already in use. If the unoccupied length is less than the preset adjustment threshold, the queue length is adjusted according to formula (VI).
[0151]
[0152] in, Indicates the adjusted queue length of the queue with priority i.
[0153] The method provided in the embodiment of the present application can save resource overhead by dynamically adjusting the queue length, reduce the processing pressure of the terminal device, and ensure that the tasks in the queue can be processed in a timely manner.
[0154] In some embodiments, the method further comprises:
[0155] Detect the slack of each second SMS sending task; adjust the priority of the second SMS sending task according to the slack; and insert the second SMS sending task into a queue corresponding to the adjusted priority according to the adjusted priority.
[0156] When the time a task must be completed - the time the task itself runs - the current time ≤ 0, the slack is 0 and the task can be executed normally.
[0157] When the time when the task must be completed - the time when the task itself runs - the current time > 0, the slack is 1, and the task cannot be completed at the required time. Then the priority of the task is adjusted according to the formula IDF(F, P) = |F*Q|*α. Among them, F includes the service label F (f1,…f n ), Q represents the preset weight Q (q1, ...q n ), where q1 represents the preset weight of the service tag f1, qn represents the preset weight of the service tag fn, and α represents the adjustment factor. The value of α is adjusted according to the actual situation, thereby adjusting the priority of the second SMS sending task. According to the adjusted priority, the second SMS sending task is inserted into the queue corresponding to the adjusted priority.
[0158] The method provided in the embodiment of the present application detects the slack of tasks in the queue and dynamically adjusts the priority of each task according to the slack, thereby adjusting the queue of tasks to ensure that tasks with high priority are executed first.
[0159] In some embodiments, step S120, sending the service tag of the first called user to the blockchain device, includes:
[0160] When the queue executes the first SMS sending task, the service tag of the first called user is sent to the blockchain device.
[0161] When the queue where the first SMS sending task is located executes the first SMS sending task, the scheduling service center module sends the service tag of the first called user to the blockchain device.
[0162] The method provided in the embodiment of the present application is that the scheduling service center module can send the service tag of the first called user to the blockchain device when the queue executes the first SMS sending task to obtain the template corresponding to the service tag, thereby generating a service SMS.
[0163] The embodiment of the present application also provides a method for generating a service SMS, which is applied to a blockchain device, wherein the blockchain device includes a template, and corresponding relationship information between a service tag and the template, wherein the service tag in the corresponding relationship information includes a service tag of a first called user;
[0164] The method includes:
[0165] S210: Receive a service tag of a first called user.
[0166] The blockchain device receives the service label sent by the scheduling service center module.
[0167] S220: Determine a template that matches the service label of the first called user according to the corresponding relationship information.
[0168] The blockchain device determines a template that matches the service label of the first called user based on the corresponding relationship information.
[0169] S230, sending the template to the terminal device.
[0170] The blockchain device sends the template to the dispatch service center module, so that the dispatch service center module generates a business SMS based on the template and the business tag.
[0171] In the method provided in the embodiment of the present application, templates, business labels, and correspondence information between business labels and templates are stored in a blockchain device, which can prevent the templates and the correspondence from being tampered with, thereby ensuring the security and accuracy of the templates and the correspondence information.
[0172] An embodiment of the present application provides a device for generating a business SMS, which may include: an acquisition module 310, a sending module 320, a receiving module 330 and a generating module 340.
[0173] An acquisition module 310 is used to acquire information to be processed from a service system, where the information to be processed includes service information and a service tag of the first called user;
[0174] A sending module 320 is used to send the service tag of the first called user to the blockchain device, so that the blockchain device determines a template matching the service tag of the first called user according to the correspondence information between the service tag and the template stored in the blockchain device, where the service tag in the correspondence information includes the service tag of the first called user;
[0175] A receiving module 330, used to receive a template sent by a blockchain device;
[0176] The generating module 340 is used to generate a business SMS according to the business information and the template.
[0177] The device provided in the embodiment of the present application obtains information to be processed from a business system, where the information to be processed includes business information and a business tag of a first called user, and sends the business tag of the first called user to a blockchain device. The blockchain device determines a template that matches the business tag of the first called user based on the correspondence information between the business tag and the template stored in the blockchain device. The business tag represents the business characteristics of the first called user, so the template that matches the business tag of the first called user fits the business characteristics of the first called user. The device receives the template sent by the blockchain device, and then generates a business SMS based on the business information and the template. Since the template fits the business characteristics of the first called user, the business information is information related to the business, and the business SMS is generated based on the business information and the template, the content of the business SMS has a high degree of fit with the business, thereby improving the fit between the content of the business SMS and the business.
[0178] An embodiment of the present application provides another device for generating a service SMS, which may include a template and correspondence information between a service tag and the template, wherein the service tag in the correspondence information includes the service tag of the first called user.
[0179] The device may include: a receiving module 410 , a determining module 420 and a sending module 430 .
[0180] The receiving module 410 is configured to receive a service tag of the first called user.
[0181] The determination module 420 is configured to determine a template matching the service label of the first called user according to the corresponding relationship information.
[0182] The sending module 430 is used to send the template to the terminal device.
[0183] The device provided in the embodiment of the present application stores templates, business labels, and correspondence information between business labels and templates, which can prevent the templates and the correspondence from being tampered with, thereby ensuring the security and accuracy of the templates and the correspondence information.
[0184] The device for generating a business SMS provided in the embodiment of the present application executes Figure 1 Each step in the method shown can achieve the technical effect of improving the relevance of the content of the business SMS to the business, and for the sake of brevity, it will not be described in detail here.
[0185] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.
[0186] The electronic device may include a processor 501 and a memory 502 storing computer program instructions.
[0187] Specifically, the processor 501 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0188] The memory 502 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 502 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 502 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 502 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 502 is a non-volatile solid-state memory. In a specific embodiment, the memory 502 includes a read-only memory (ROM). In appropriate cases, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM) or a flash memory or a combination of two or more of these.
[0189] The processor 501 reads and executes the computer program instructions stored in the memory 502 to implement Figure 1 to Figure 2 Any method for generating a business SMS in the illustrated embodiments.
[0190] In one example, the electronic device may further include a communication interface 503 and a bus 510. Figure 5 As shown, the processor 501, the memory 502, and the communication interface 503 are connected via a bus 510 and communicate with each other.
[0191] The communication interface 503 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0192] Bus 510 includes hardware, software or both, and the parts of electronic equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 510 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.
[0193] The electronic device can execute the method for generating a business SMS in the embodiment of the present application, thereby realizing the combination Figure 1 Describes a method for generating business text messages.
[0194] In addition, in combination with the method for generating a service SMS in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the methods for generating a service SMS in the above embodiment is implemented.
[0195] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0196] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0197] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0198] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A method for generating a business SMS, characterized in that: Applied to a terminal device, the method comprises: Acquire information to be processed from the service system, where the information to be processed includes service information and a service tag of the first called user; Sending the service tag of the first called user to the blockchain device, so that the blockchain device determines a template matching the service tag of the first called user according to the correspondence information between the service tags and the templates stored in the blockchain device, where the service tags in the correspondence information include the service tag of the first called user; Receiving the template sent by the blockchain device; Generate a business SMS according to the business information and the template; The blockchain device also includes a preset weight of each of the service tags. Before sending the service tag of the first called user to the blockchain device, the method further includes: Generate a first SMS sending task according to the information to be processed; Acquire a preset weight of the service tag of the first called user from the blockchain device; Calculating the priority of the first SMS sending task according to the service tag of the first called user and the preset weight; According to the priority of the first SMS sending task, inserting the first SMS sending task into a queue corresponding to the priority; The method further comprises: detecting the slack of each second SMS sending task, where the second SMS sending task includes the first SMS sending task; According to the slack, adjusting the priority of the second SMS sending task; According to the adjusted priority, inserting the second SMS sending task into the queue corresponding to the adjusted priority; Among them, when the time when the task must be completed - the time when the task itself runs - the current time ≤ 0, the slack is 0, indicating that the task can be executed normally; when the time when the task must be completed - the time when the task itself runs - the current time > 0, the slack is 1, indicating that the task cannot be completed at the time it must be completed.
2. The method according to claim 1, characterized in that Before obtaining the information to be processed from the business system, The method further comprises: Acquire service tags of multiple second called users and service text messages of the second called users within a preset time period, where the second called users include the first called user; Determine a third user whose number of service tags among the second called users is less than a preset threshold; Determine the service text messages of the third user within the preset time period as samples; Generate a template corresponding to the business label corresponding to the sample; According to the service tag corresponding to the sample and the template corresponding to the service tag corresponding to the sample, correspondence information between the service tag corresponding to the sample and the template corresponding to the service tag corresponding to the sample is generated.
3. The method according to claim 2, characterized in that The method further comprises: The template and the corresponding relationship information are sent to a blockchain device so that the blockchain device receives and stores the template and the corresponding relationship information.
4. The method according to claim 3, characterized in that: The sending the template and the corresponding relationship information to the blockchain device includes: Get the encryption key from the key generation module; Through the smart contract module, the encryption key, the template and the corresponding relationship information are sent to the blockchain device.
5. The method according to claim 4, characterized in that The receiving the template sent by the blockchain device includes: Obtaining a decryption key generated by the business system; When the blockchain device successfully verifies the service system according to the encryption key and the decryption key, a template matching the service label of the first called user sent by the blockchain device is received.
6. The method according to claim 5, characterized in that The method further comprises: Obtaining a preset length and a preset adjustment threshold of each queue, and the number of second SMS sending tasks in each of the queues; Calculate the unoccupied length of each queue according to the preset length and the number of the second SMS sending tasks; When the unoccupied length is less than the preset adjustment threshold, the preset length of the queue is adjusted according to the preset length and the number of the second SMS sending tasks.
7. The method according to claim 6, characterized in that The sending the service tag of the first called user to the blockchain device includes: When the queue executes the first SMS sending task, the service tag of the first called user is sent to the blockchain device.
8. A method for generating a business SMS, characterized in that: Applied to a blockchain device, the blockchain device includes a template, and correspondence information between a service tag and the template, wherein the service tag in the correspondence information includes a service tag of a first called user; The method comprises: Receiving a service tag of the first called user sent by a terminal device; Determining, according to the corresponding relationship information, a template matching the service label of the first called user; Sending the template to a terminal device; The blockchain device also includes a preset weight of each of the service tags. Before the terminal device sends the service tag of the first called user to the blockchain device, the terminal device also generates a first SMS sending task according to the information to be processed; obtains the preset weight of the service tag of the first called user from the blockchain device; calculates the priority of the first SMS sending task according to the service tag of the first called user and the preset weight; and inserts the first SMS sending task into a queue corresponding to the priority according to the priority of the first SMS sending task; The terminal device further detects the slack of each second SMS sending task, the second SMS sending task including the first SMS sending task; according to the slack, adjusts the priority of the second SMS sending task; according to the adjusted priority, inserts the second SMS sending task into a queue corresponding to the adjusted priority; Among them, when the time when the task must be completed - the time when the task itself runs - the current time ≤ 0, the slack is 0, indicating that the task can be executed normally; when the time when the task must be completed - the time when the task itself runs - the current time > 0, the slack is 1, indicating that the task cannot be completed at the time it must be completed.
9. A device for generating business short messages, characterized in that: Applied to a terminal device, the device comprises: An acquisition module, used for acquiring information to be processed from a service system, wherein the information to be processed includes service information and a service tag of the first called user; A sending module, configured to send the service tag of the first called user to a blockchain device, so that the blockchain device determines a template matching the service tag of the first called user according to the correspondence information between the service tag and the template stored in the blockchain device, wherein the service tag in the correspondence information includes the service tag of the first called user; A receiving module, used to receive the template sent by the blockchain device; A generating module, used for generating a business SMS according to the business information and the template; The blockchain device also includes a preset weight of each of the service tags. Before sending the service tag of the first called user to the blockchain device, the device for generating a service SMS also generates a first SMS sending task according to the information to be processed; obtains the preset weight of the service tag of the first called user from the blockchain device; calculates the priority of the first SMS sending task according to the service tag of the first called user and the preset weight; and inserts the first SMS sending task into a queue corresponding to the priority according to the priority of the first SMS sending task; The device for generating a service SMS also detects the slack of each second SMS sending task, where the second SMS sending task includes the first SMS sending task; according to the slack, adjusts the priority of the second SMS sending task; and according to the adjusted priority, inserts the second SMS sending task into a queue corresponding to the adjusted priority; Among them, when the time when the task must be completed - the time when the task itself runs - the current time ≤ 0, the slack is 0, indicating that the task can be executed normally; when the time when the task must be completed - the time when the task itself runs - the current time > 0, the slack is 1, indicating that the task cannot be completed at the time it must be completed.
10. A device for generating a business short message, characterized in that: Applied to a blockchain device, the device includes a template, and correspondence information between a service tag and the template, wherein the service tag in the correspondence information includes a service tag of a first called user; The device comprises: A receiving module, configured to receive a service tag of the first called user sent by a terminal device; A determination module, configured to determine a template matching the service label of the first called user according to the corresponding relationship information; A sending module, used for sending the template to a terminal device; The blockchain device also includes a preset weight of each of the service tags. Before the terminal device sends the service tag of the first called user to the blockchain device, the terminal device also generates a first SMS sending task according to the information to be processed; obtains the preset weight of the service tag of the first called user from the blockchain device; calculates the priority of the first SMS sending task according to the service tag of the first called user and the preset weight; and inserts the first SMS sending task into a queue corresponding to the priority according to the priority of the first SMS sending task; The terminal device further detects the slack of each second SMS sending task, the second SMS sending task including the first SMS sending task; according to the slack, adjusts the priority of the second SMS sending task; according to the adjusted priority, inserts the second SMS sending task into a queue corresponding to the adjusted priority; Among them, when the time when the task must be completed - the time when the task itself runs - the current time ≤ 0, the slack is 0, indicating that the task can be executed normally; when the time when the task must be completed - the time when the task itself runs - the current time > 0, the slack is 1, indicating that the task cannot be completed at the time it must be completed.
11. An electronic device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the method for generating a business SMS as claimed in any one of claims 1 to 7 or claim 8 is implemented.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by the processor, the method for generating a business SMS as described in any one of claims 1 to 7 or claim 8 is implemented.
