WO2021104178A1 - 一种动态消息推送方法、系统和汽车诊断服务器 - Google Patents

一种动态消息推送方法、系统和汽车诊断服务器 Download PDF

Info

Publication number
WO2021104178A1
WO2021104178A1 PCT/CN2020/130607 CN2020130607W WO2021104178A1 WO 2021104178 A1 WO2021104178 A1 WO 2021104178A1 CN 2020130607 W CN2020130607 W CN 2020130607W WO 2021104178 A1 WO2021104178 A1 WO 2021104178A1
Authority
WO
WIPO (PCT)
Prior art keywords
push
message
time
dynamic
task
Prior art date
Application number
PCT/CN2020/130607
Other languages
English (en)
French (fr)
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 WO2021104178A1 publication Critical patent/WO2021104178A1/zh

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation

Definitions

  • This application relates to the field of communication technology, and in particular to a dynamic message push method, system and automobile diagnosis server.
  • an embodiment of the present invention provides a dynamic message push method, the method is applied to a message push system, and the method includes:
  • the current scan time point belongs to a preset scan time point determined according to a preset time frequency; the scan time period is based on the preset scan time point The time period of the starting point, the message push system is used to scan at least one push time within the scanning period;
  • the duration of the scanning period is greater than or equal to the value of the preset time frequency.
  • the method further includes:
  • the method further includes:
  • the method further includes:
  • the method further includes:
  • the determining the push time of the dynamic message includes:
  • an embodiment of the present invention also provides a dynamic message push system, including:
  • the receiving module is used to receive push requests of dynamic messages from the business system
  • a message push time calculator which is used to determine the push time of the dynamic message
  • the current scan time point belongs to a preset scan time point determined according to a preset time frequency;
  • the scan time period is A time period starting from the preset scanning time point, the message push system is used to scan at least one push time within the scanning time period;
  • the message push task generator is used to, if yes, create a message push task for the dynamic message according to the push time and the dynamic message, and the message push task is used to push the dynamic message at the push time news.
  • an embodiment of the present invention also provides a car diagnosis server, including:
  • At least one processor and,
  • a memory communicatively connected with the at least one processor; wherein,
  • the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the above-mentioned dynamic message pushing method.
  • embodiments of the present invention also provide a non-volatile computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor , Enabling the processor to execute the above-mentioned dynamic message pushing method.
  • the beneficial effect of the present invention is that, different from the situation in the prior art, the dynamic message push method in the embodiment of the present invention receives a push request for a dynamic message from a business system, and then determines the dynamic message Then it is judged whether the push time is within the scanning period of the current scanning time point. If so, a message push task for the dynamic message is created according to the push time and the dynamic message, so that the push can be processed in time Messages, to avoid the situation that push messages cannot be pushed in time due to accumulation of push messages.
  • Figure 1 is a schematic diagram of an application scenario of a dynamic message push method in an embodiment of the present invention
  • Figure 2 is a schematic diagram of the structure of the dynamic message push system of the present invention.
  • FIG. 3 is a flowchart of creating a message push task in an embodiment of the dynamic message push method of the present invention
  • FIG. 4 is a schematic diagram of preset time frequency and scanning period in an embodiment of the dynamic message push method of the present invention.
  • FIG. 5 is a schematic flowchart of creating a message push task in another embodiment of the dynamic message push method of the present invention.
  • FIG. 6 is a schematic flowchart of executing an unexpired message push task in an embodiment of the dynamic message push method of the present invention
  • FIG. 7 is a detailed flowchart of a dynamic message push method in an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of an embodiment of the dynamic message push system of the present invention.
  • Fig. 9 is a schematic diagram of the hardware structure of a car diagnostic server in an embodiment of the present invention.
  • Fig. 1 exemplarily shows a client 10 and a car diagnostic server 20.
  • the client 10 is connected to the car diagnostic server 20 through network communication, for example, through a local area network, a wide area network, a wireless network, and a global system of mobile communication (Global System of Mobile). Communication, GSM), a third-generation mobile communication network, a fourth-generation mobile communication network, and a fifth-generation mobile communication network are communicatively connected to the car diagnostic server 20.
  • GSM Global System of Mobile
  • the client terminal 10 may be, for example, a special-purpose automobile diagnostic equipment, a mobile phone, a tablet computer, a personal computer, a laptop computer, and the like.
  • the car diagnostic server 20 may be a server, such as a rack server, a blade server, a tower server, or a cabinet server, etc., or a server cluster composed of several servers, or a cloud computing service center.
  • the method provided in the embodiment of the present application can be further extended to other suitable application environments, and is not limited to the application environment shown in FIG. 1.
  • the application environment may also include more or fewer clients and car diagnostic servers.
  • the car diagnosis server 20 can implement business functions such as car diagnosis, repair, maintenance, and client management, and the client 10 can communicate with the car diagnosis server 20 to obtain diagnosis results, maintenance plans, and the like of the car diagnosis server 20.
  • the client terminal 10 can also obtain dynamic messages pushed by the car diagnostic server 20, and the dynamic messages are mostly dynamic messages generated instantly by the car diagnostic server 20 according to business requirements. Since the time generation of dynamic messages is random, how to process these dynamic messages so that they can be pushed to the client is a subject to be studied by those skilled in the art.
  • Redis Remote Dictionary Server: remote dictionary service
  • Redis Remote Dictionary Server: remote dictionary service
  • Redis is too late to process a large number of expired keys, which causes a large delay in the subscription end, that is, the client receiving the expiration reminder, which affects normal business processing .
  • an embodiment of the present invention provides a dynamic message push system, including a business system, a timed task system, a message push system, and a client.
  • the business system and the timed task system are communicatively connected to the message push system
  • the message push system is communicatively connected to the client.
  • the message push system receives the push request of the dynamic message from the business system, analyzes and processes the dynamic message according to the push request, determines the push time of the dynamic message, and then determines whether the push time is within the scan period of the current scan time point If yes, create a message push task, and push the dynamic message to the client when the push time arrives.
  • the timing task system is used to manage all timing tasks and configure execution time or frequency for each timing task. When the system time is reached, the timing task system automatically sends out timing tasks.
  • the message push system includes a message push time calculator, a message immediacy checker, a message push record persistence layer, a timing task listener, a database, a message push task generator, cache, memory, and various APIs (application program interfaces) Interfaces, such as SMS sending interface, mail sending interface, and in-site notification sending interface, etc.
  • the message push time calculator is used to calculate the push time of the dynamic message
  • the message immediacy checker is used to check whether the push time of the current push message request from the business system is within the scanning period of the current scanning time point
  • timing tasks The listener is used to monitor the timed task system.
  • the timed task listener scans the database at the preset scan time point and pushes the items to be pushed within the scan period of the preset scan time point.
  • Message push record The message push task generator is used to create message push tasks, manage and schedule message push tasks, and formulate execution plans for message push tasks. Among them, the message push task generator can be used by the thread pool task scheduler (Thread Pool Task Scheduler). Scheduler) implementation.
  • the message push time calculator, message immediacy checker, timed task listener, and message push task generator are all software modules.
  • an embodiment of the present invention provides a dynamic message push method, which is applied to a message push system, and the method includes:
  • Step 302 Receive a push request for a dynamic message from the business system.
  • the push request of the dynamic message may include the ID of the client, for example, and the business system may be, for example, a system for processing car diagnosis services.
  • the business system is used to send push messages to the client to remind users to perform car repair, diagnosis, and maintenance. Maintenance, provide users with maintenance programs, etc. Exemplarily, when the user's car is 3 months after the last maintenance, at this time, the business system needs to send a push message to the client to remind the user to perform car maintenance.
  • the message push system receives a push request for a dynamic message from the business system.
  • Step 304 Determine the push time of the dynamic message.
  • the pushing time is the time used by the message pushing system to push dynamic messages. Specifically, after the message push system receives the push request of the dynamic message from the business system, it determines the push time of the dynamic message based on the push request.
  • the push time of the dynamic message can also be understood as the execution time of executing the task of pushing the dynamic message.
  • the push time of the dynamic message is calculated according to the request time in the push request and a preset time calculation logic.
  • common message push time calculation logic can be encapsulated in the message push system in advance, for example, around 24 hours, the day before, etc., or a calculated timestamp can be set in the message push system in advance.
  • the push system calculates the push time of the dynamic message according to the request time in the push request and the pre-encapsulated time calculation logic, so that it can manage the calculation of the message push time uniformly and flexibly, and can avoid the repeated implementation of the same calculation logic , Thereby improving efficiency.
  • the request time carried in the push request is one month, and the current time is 9:00 am on November 20, 2019.
  • the push time is one month after the current time, because the message push system is pre-packaged Commonly used message push time calculation logic, therefore, the message push system calculates the push time of the dynamic message as December 2019 according to the request time in the push request and the pre-packaged time calculation logic (1 month) 9 am on the 20th.
  • Step 306 Determine whether the push time is within the scan period of the current scan time point; the current scan time point belongs to a preset scan time point determined according to a preset time frequency; the scan time period is based on the preset scan time The time point is the time period of the starting point, and the message push system is used to scan at least one push time within the scanning period.
  • the push time after the push time is calculated, it can be directly determined whether the push time is within the scan time period of the current scan time point, so that the execution task of the dynamic message can be processed in time.
  • the scanning time point refers to the time point at which the dynamic message push task is scanned, so as to scan out the dynamic message push task that needs to be executed during the scanning period of the time point.
  • the scanning time point may be preset, which may be determined according to the preset time frequency, that is, the time interval between adjacent scanning time points is the same.
  • the scanning time period is used to filter out the dynamic message tasks that are planned to be executed, that is, to filter out the dynamic message tasks whose push time is within the scanning time period, and the message push system can further plan the dynamic message tasks whose push time falls within the scanning time period.
  • the current scan time point refers to a preset scan time point before the push time and closest to the push time. Since the current scan time point has passed, a push time judgment can be made after the push time is calculated. , That is, to judge the push time of this dynamic message outside the preset scanning time point. If the push time falls within the scanning period of the current scan time point, the dynamic message can be processed directly, adding dynamic message processing Flexibility.
  • the dynamic message task with the push time after the dynamic message task with the push time is just generated, it can be instantly judged whether the push time falls within the scanning period of the current scanning time point, and the dynamic message task can be processed immediately, which avoids The postponement of the dynamic message task improves the processing efficiency of the dynamic message task.
  • the preset scanning time points are 0 o'clock, 2 o'clock, 4 o'clock, 6 o'clock, and 8 o'clock.
  • the current scan time point is a preset scan time point determined according to a preset time frequency, for example, the preset time frequency is a scan once every 2 hours.
  • the scanning period is a time period starting from the preset scanning time point, for example, 0 o'clock-3 o'clock is a scanning period, and 2 o'clock-5 o'clock is another scanning period.
  • the scanning period of each scanning time point can be the same or different.
  • the scan period can be greater than or equal to the preset time frequency, that is, the scan period covers the time period between two adjacent scan points, so as to ensure that each push time can be scanned.
  • the two ends of the scan period can include the preset time. Point, or not including the preset time point.
  • the setting of the scanning period can also be determined according to scanning requirements or business push requirements, which is not limited here.
  • the current scanning time point is 2 o'clock
  • the scanning period is 2 o'clock to 5 o'clock, that is, the length of the scanning period is 3 hours, which is greater than the preset time frequency, which can ensure that the push time is scanned to And there is a cross scanning area in the scanning period of each scanning time point, which can ensure that the push time is scanned multiple times.
  • the message push system starts the scanning program, scans the dynamic messages with the push time between 2 o'clock and 5 o'clock, generates push tasks for the scanned dynamic messages, and schedules the execution of the dynamic message push tasks to make Each dynamic message push task can be pushed on time at each corresponding push time.
  • the system scans out the dynamic message push task A with the push time between 4 o'clock and 5 o'clock at 2 o'clock, and can plan the execution of the dynamic message push task A in this scan, and the status of the dynamic message push task A Can be changed to planned.
  • the system scans the dynamic message push task A at 4 o'clock, it can ignore the processing of the dynamic message push task A according to its status, and further process the new one scanned at 4 o'clock.
  • the system when the system receives a push request for a dynamic message, it calculates that the push time of the dynamic message is 3:30, and it can be judged that 3:30 falls into the scan period of the current scan time point ( 2:00 to 5:00), the dynamic message can be processed immediately, such as creating a message push task for the dynamic message to ensure that the dynamic message can be pushed in time at 3:30 without waiting for the next scan time Point 4 to avoid expiration of the push time of the dynamic message, and the dynamic message is not processed in time.
  • the embodiment of the present application not only provides a periodic scanning method, but also provides an instant processing method, which enables the dynamic message to be processed in time and avoids the expiration of the push time.
  • the preset scanning time point and the preset time frequency can be set according to business requirements, and the current scanning time point and the scanning period will change with the difference between the preset scanning time point and the preset time frequency.
  • Step 308 If yes, create a message push task for the dynamic message according to the push time and the dynamic message, and the message push task is used to push the dynamic message at the push time.
  • the message push task is to push the dynamic message when the push time arrives. Specifically, when the pushing time is within the scanning period of the current scanning time point, a push task for the dynamic message is created according to the pushing time and the dynamic message. Exemplarily, the push time of the dynamic message is 1 o'clock, and when the push time arrives, the message push system pushes the dynamic message to the client through the short message sending interface, the email sending interface, or the in-site notification sending interface, thereby The push messages can be processed in time to avoid the situation that push messages cannot be pushed in time due to accumulation of push messages.
  • the message push system receives the push request of the dynamic message from the business system, determines the push time of the dynamic message, and then determines whether the push time is within the scan period of the current scan time point, and if so, according to The push time and the dynamic message create a message push task for the dynamic message, so that the push message can be processed in time, and the situation that the accumulation of push messages can not be pushed in time can be avoided.
  • the method further includes:
  • Step 502 if not, save the push time and the dynamic message as a message push record in the database.
  • the dynamic message and the push time may be recorded in the database first to form a message push record.
  • the message push record includes The dynamic message and the push time of the dynamic message.
  • the push time of the dynamic message is 6 o'clock
  • the preset time frequency is scan once every 2 hours
  • the current scan time point is 2 o'clock
  • the scan time period is 2 o'clock-5 o'clock
  • the push time is considered (6 o'clock) is not within the scanning period (2 o'clock-5 o'clock) of the current scanning time point (2 o'clock)
  • the push time and the dynamic message are stored in the database as a message push record.
  • Step 504 Scan at a preset scan time point to scan out the message push records to be pushed in the database and the push time is within the scan time period of the preset scan time point.
  • Step 506 Create a message push task according to the message push record to be pushed.
  • each message push record includes different push times and dynamic messages.
  • the push time of message push record A is 1 o'clock
  • the push time of message push record B is 5 o'clock
  • the push of message push record C The time is 7 o'clock
  • the preset scanning time point is 4 o'clock
  • the preset time frequency is 2 hours
  • the scanning period is 2 o'clock-5 o'clock.
  • the push time of message push record B (5 o'clock) is at the preset scanning time point (4 o'clock) within the scanning period (2 o'clock-5 o'clock), when you scan at 4 o'clock, you can confirm that the message push record B is the message push record to be pushed, and the dynamic message and push time in the message push record B Create a message push task.
  • the method further includes: updating the status of the message push record to be pushed, so that the message push record to be pushed is excluded from the scanning range of the next preset scanning time point.
  • the message push task in order to ensure that the message push task can continue normally even when the message push system is redeployed or restarted due to an exception, the message push task needs to be saved in the cache, so as to improve the reliability of the message push system.
  • the message push task after each message push task is saved in the cache, it will have a unique identification, so as to facilitate the distinction between different message push tasks.
  • the method further includes:
  • Step 602 After the message push system restarts, obtain at least one message push task in the cache.
  • the message push task will be saved in the cache, and when the message push system is restarted, at least one message push task in the cache will be obtained. It should be noted that only after the message push system restarts, the message push task in the cache will be obtained once.
  • Step 604 Execute an unexpired message push task among the at least one message push task according to the execution plan.
  • the execution plan is implemented based on the thread pool task scheduler (Thread Pool Task Schedule), which is used to plan the execution of each task according to the preparation time, that is, to formulate the scheduling plan of the message push task.
  • the unexpired message push task means that the push time of the dynamic message is later than the restart time of the message push system, or the task that obtains the message task time is an unexpired task. Specifically, after the message push system restarts, at least one message push task in the cache is acquired, and the unexpired message push task among the message push tasks is executed based on the thread pool task scheduler.
  • Step 606 Clear the expired message push task in the at least one message push task in the cache.
  • the message push system receives a push request for a dynamic message from the business system, and then calculates the push of the dynamic message according to the request time in the push request and the pre-encapsulated time calculation logic Time, and then determine whether the push time is within the scan period of the current scan time point, if the push time is within the scan time period of the current scan time point, create a response to the dynamics according to the push time and the dynamic message
  • the duration of the scan period is greater than or equal to the value of the preset time frequency.
  • the preset scanning time points are 0 o'clock, 2 o'clock, 4 o'clock, 6 o'clock, and 8 o'clock
  • the preset time frequency is scanning once every 2 hours.
  • the scanning period is the time period starting from the preset scanning time point, for example, 0 o'clock-3 o'clock is the preset scanning time point 0 o'clock scanning period, 2 o'clock-5 o'clock is the preset scanning time point is 2 o'clock The scanning period.
  • the message push system pushes the dynamic message to the client through at least one of the short message sending interface, the email sending interface, and the in-site notification sending interface. This can process push messages in a timely manner.
  • the message push task needs to be stored in the cache, thereby improving the reliability of the message push system.
  • the pushing time and the dynamic message are stored in the database as a message pushing record.
  • the push time of the dynamic message is 6 o'clock
  • the current scan time point is 2 o'clock
  • the scan period is 2 o'clock-5 o'clock
  • the push time and the dynamic message are stored in the database as a message push record.
  • Multiple message push records are stored in the database, and each message push record includes a push time and a dynamic message.
  • the push time of message push record A is 5 o'clock
  • the push time of message push record B is 7 o'clock
  • the push of message push record C The time is 9 o'clock
  • the preset scanning time point is 4 o'clock
  • the scanning period is 4 o'clock-7 o'clock.
  • the push time of message push record A is the scanning period of the preset scanning time point (4 o'clock) (4 to 7 o’clock), create a message push task according to the message push records A and B, so that the dynamic message in the message push record A is pushed at 5 o’clock, and the dynamic message in the message push record B is pushed at 7 o’clock. .
  • the status of the message push records A and B is updated, such as updated to a scheduled or created task, to be at the next preset scanning time point ( 6 points)
  • scanning the scanning of the message push record A and the message push record B is excluded, that is, the status of the message push record A and B indicates that they have been processed, thereby improving the scanning efficiency.
  • the message push record status can also be updated, indicating that the message to be pushed task has been completed, and the message push history is recorded at the same time, and the message push history and the message push record status They are also saved in the database.
  • the message push task in the cache is cleared.
  • the message push system fails or crashes, after the message push system restarts, at least one message push task in the cache will be obtained.
  • These message push tasks come from the message push tasks created based on the records in the database. , Or the message push task created according to the above real-time judgment step, and the unexpired message push task in the message push task is executed by the thread pool task scheduler based on the thread pool task scheduler, so as to ensure the maximum timely push of the message push task.
  • the unexpired message push task means that the push time of the dynamic message is later than the restart time of the message push system, or the task that obtains the message task time is an unexpired task. In order to save memory, after the message push task is executed, the expired message push task in the cache is cleared.
  • an embodiment of the present invention provides a dynamic message push system 800, as shown in FIG. 8, including:
  • the receiving module 802 is used to receive push requests of dynamic messages from the business system
  • the message push time calculator 804 is used to determine the push time of the dynamic message
  • the message immediacy checker 806 is used to determine whether the push time is within the scanning period of the current scanning time point; the current scanning time point belongs to a preset scanning time point determined according to a preset time frequency; the scanning time period Is a time period starting from the preset scanning time point, the message push system is used to scan at least one push time within the scanning time period;
  • the message push task generator 808 is configured to, if yes, create a message push task for the dynamic message according to the push time and the dynamic message, and the message push task is used to push the message at the push time. Dynamic news.
  • the dynamic message push system receives the push request of the dynamic message from the business system through the receiving module, calculates the push time of the dynamic message through the message push time calculator, and then uses the message immediacy checker to determine the information. Whether the push time is within the scan period of the current scan time point, if the push time is within the scan time period of the current scan time point, the message push task generator is used to create a target for the push time and the dynamic message according to the push time and the dynamic message.
  • the message push task of dynamic messages can thus process push messages in time, avoiding the situation that push messages cannot be pushed in time due to accumulation of push messages.
  • system 800 further includes:
  • the saving module 810 is configured to, if not, save the push time and the dynamic message as a message push record in the database.
  • the timed task listener 812 is configured to scan out the message push records to be pushed in the database with the push time within the scan time period of the preset scan time point at the preset scan time point.
  • system 800 further includes:
  • the update module 814 is configured to update the status of the message push record to be pushed, so that the message push record to be pushed is excluded from the scanning range of the next preset scanning time point.
  • system 800 further includes:
  • the obtaining module 816 is configured to obtain at least one message pushing task in the cache after the message pushing system is restarted.
  • the execution module 818 is configured to execute the unexpired message push task in the at least one message push task according to the execution plan;
  • the clearing module 820 is configured to clear expired message push tasks in the at least one message push task in the cache.
  • the message push time calculator 804 is specifically used to:
  • the message push task generator 808 is specifically configured to:
  • the saving module 810 is specifically configured to:
  • the above-mentioned dynamic message push system can execute the dynamic message push method provided by the embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
  • the technical details that are not described in detail in the dynamic message push system embodiment can be Refer to the dynamic message push method provided in the embodiment of the present invention.
  • Fig. 9 is a schematic diagram of the hardware structure of a car diagnostic server provided by an embodiment of the present invention.
  • the car diagnosis server 900 includes:
  • One processor 902 is taken as an example in FIG. 9.
  • the processor 902 and the memory 904 may be connected through a bus or in other ways.
  • the connection through a bus is taken as an example.
  • the memory 904 can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the programs corresponding to the dynamic message push method in the embodiment of the present invention Instructions/modules (for example, the receiving module 802, the message push time calculator 804, the message immediacy checker 806, the message push task generator 808, the save module 810, the timed task listener 812, and the update module 814 shown in FIG. 8 , Obtaining module 816, Executing module 818, and Clearing module 820).
  • the processor 902 executes various functional applications and data processing of the automobile diagnosis server by running the non-volatile software programs, instructions, and modules stored in the memory 904, that is, realizing the dynamic message pushing method of the foregoing method embodiment.
  • the memory 904 may include a program storage area and a data storage area.
  • the program storage area may store an operating system and an application program required by at least one function; the data storage area may store data created according to the use of the dynamic message push system.
  • the memory 904 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices.
  • the memory 904 may optionally include a memory remotely provided with respect to the processor 902, and these remote memories may be connected to the dynamic message push system through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the one or more modules are stored in the memory 904, and when executed by the one or more car diagnosis servers, the dynamic message push method in any of the above method embodiments is executed, for example, the above-described FIG. 3 is executed. Steps 302 to 308 in the method, steps 502 to 506 in the method in FIG. 5, and steps 602 to 606 in the method in FIG. 6; realize the functions of the modules 802 to 820 in FIG.
  • the embodiment of the present invention also provides a computer program product, which includes a calculation program stored on a non-volatile computer-readable storage medium.
  • the computer program includes program instructions that, when executed by a computer, cause all Said computer execution: method steps 302 to step 308 in FIG. 3, method steps 502 to step 506 in FIG. 5, and method steps 602 to step 606 in FIG.
  • the car diagnosis server in the embodiment of the present invention exists in various forms, including but not limited to:
  • the general tower server case is similar to our commonly used PC case, while the large tower case is much larger. Generally speaking, there is no fixed standard for the external dimensions.
  • Rack-mounted servers are designed to meet the intensive deployment of enterprises.
  • the 19-inch rack is used as the standard width of the server type, and the height ranges from 1U to several U. Placing the server on the rack is not only conducive to daily maintenance and management, but may also avoid unexpected failures. First of all, placing the server does not take up too much space.
  • Rack servers are neatly arranged in the racks without wasting space.
  • the connecting wires can also be neatly stored in the rack.
  • Power cables and LAN cables can all be routed in the cabinet, which can reduce the number of connecting cables piled up on the ground and prevent accidents such as kicking off the cables.
  • the blade server is a low-cost server platform of HAHD (High Availability High Density). It is specially designed for special application industries and high-density computer environments.
  • Each "blade" is actually a system motherboard. , Similar to independent servers. In this mode, each motherboard runs its own system, serving different designated user groups, and is not related to each other. However, the system software can be used to assemble these motherboards into a server cluster. In the cluster mode, all motherboards can be connected to provide a high-speed network environment, can share resources, and serve the same user group.
  • Cloud Server (Elastic Compute Service, ECS) is a simple, efficient, safe and reliable computing service with elastically scalable processing capabilities. Its management method is simpler and more efficient than physical servers. Users can quickly create or release any number of cloud servers without having to purchase hardware in advance.
  • the distributed storage of cloud servers is used to integrate a large number of servers into a supercomputer, providing a large amount of data storage and processing services.
  • Distributed file systems and distributed databases allow access to common storage resources and realize IO sharing of application data files.
  • Virtual machines can break through the limitations of a single physical machine, dynamically adjust and allocate resources to eliminate single points of failure of servers and storage devices, and achieve high availability.
  • the device embodiments described above are merely illustrative, where the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • each implementation manner can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware.
  • a person of ordinary skill in the art can understand that all or part of the processes in the methods of the foregoing embodiments can be implemented by instructing relevant hardware through a computer program.
  • the program can be stored in a computer-readable storage medium, and the program can be stored in a computer readable storage medium. When executed, it may include the procedures of the above-mentioned method embodiments.
  • the storage medium can be magnetic disk, optical disk, read-only
  • ROM Read-Only Memory
  • RAM Random Access Memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computational Linguistics (AREA)
  • Debugging And Monitoring (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明涉及通信技术领域,公开了一种动态消息推送方法、系统和汽车诊断服务器。方法应用于消息推送系统,包括:从业务系统接收动态消息的推送请求,判断推送时间是否在当前扫描时间点的扫描时段内;当前扫描时间点属于按照预设时间频率确定的预设扫描时间点;扫描时段为以预设扫描时间点为起点的时间段;消息推送系统用于扫描在扫描时段内的至少一个推送时间;若为是,则根据推送时间和动态消息创建针对动态消息的消息推送任务,消息推送任务用于在推送时间推送动态消息,由此能够及时处理推送消息,避免推送消息堆积导致不能及时推送的情形。

Description

一种动态消息推送方法、系统和汽车诊断服务器
本申请要求于2019年11月27日提交中国专利局、申请号为201911182311.3、申请名称为“一种动态消息推送方法、系统和汽车诊断服务器”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,特别是涉及一种动态消息推送方法、系统和汽车诊断服务器。
背景技术
随着互联网的快速发展,互联网已经渗入到了各行各业,汽车诊断也不例外。在汽车诊断的过程中,存在需要向客户端用户推送消息的场景。而当某个时刻需要向大量的客户端用户推送消息时,往往存在消息推送任务量大,从而导致消息推送不及时的情况。
发明内容
基于此,有必要针对上述技术问题,提供一种动态消息推送方法、系统和汽车诊断服务器,能够及时处理推送消息,避免推送消息堆积导致不能及时推送的情形。
第一方面,本发明实施例提供了一种动态消息推送方法,所述方法应用于消息推送系统,所述方法包括:
从业务系统接收动态消息的推送请求;
确定所述动态消息的推送时间;
判断所述推送时间是否在当前扫描时间点的扫描时段内;所述当前扫描时间点属于按照预设时间频率确定的预设扫描时间点;所述扫描时段为以所述预设扫描时间点为起点的时间段,所述消息推送系统用于扫描在所述扫描时段内的至少一个推送时间;
若为是,则根据所述推送时间和所述动态消息创建针对所述动态消息的消息推送任务,所述消息推送任务用于在所述推送时间推送所述动态消息。
在一些实施例中,所述扫描时段的时长大于或等于所述预设时间频率的值。
在一些实施例中,所述方法还包括:
若为否,将所述推送时间和所述动态消息作为一个消息推送记录保存在数据库中;
在所述预设扫描时间点扫描出所述数据库中推送时间在所述预设扫描时间点的扫描时段内的待推送的消息推送记录;
根据所述待推送的消息推送记录创建消息推送任务。
在一些实施例中,所述方法还包括:
更新所述待推送的消息推送记录的状态,以使所述待推送的消息推送记录排除在下一个预设扫描时间点的扫描范围内。
在一些实施例中,所述方法还包括:
将所述消息推送任务保存至缓存中。
在一些实施例中,所述方法还包括:
在所述消息推送系统重启后,获取所述缓存中的至少一个消息推送任务;
按照执行计划执行所述至少一个消息推送任务中未过期的消息推送任务;
在所述缓存中清除所述至少一个消息推送任务中的过期的消息推送任务。
在一些实施例中,所述确定所述动态消息的推送时间,包括:
根据所述推送请求中的请求时间和预设的时间计算逻辑,计算所述动态消息的推送时间。
第二方面,本发明实施例还提供了一种动态消息推送系统,包括:
接收模块,用于从业务系统接收动态消息的推送请求;
消息推送时间计算器,用于确定所述动态消息的推送时间;
消息即时性校验器,用于判断所述推送时间是否在当前扫描时间点的扫描时段内;所述当前扫描时间点属于按照预设时间频率确定的预设扫描时间点;所述扫描时段为以所述预设扫描时间点为起点的时间段,所述消息推送系统用于扫描在所述扫描时段内的至少一个推送时间;
消息推送任务生成器,用于若为是,则根据所述推送时间和所述动态消息创建针对所述动态消息的消息推送任务,所述消息推送任务用于在所述推送时间推送所述动态消息。
第三方面,本发明实施例还提供了一种汽车诊断服务器,包括:
至少一个处理器;以及,
与所述至少一个处理器通信连接的存储器;其中,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述动态消息推送方法。
第四方面,本发明实施例还提供了一种非易失性计算机可读存储介质,所述计算机可读存储介质存储有计算机可执行指令,当所述计算机可执行指令被处理器所执行时,使所述处理器执行上述动态消息推送方法。
与现有技术相比,本发明的有益效果是:区别于现有技术的情况,本发明实施例中的动态消息推送方法,通过从业务系统接收动态消息的推送请求,然后确定所述动态消息的推送时间,接着判断所述推送时间是否在当前扫描时间点的扫描时段内,若是,则根据所述推送时间和所述动态消息创建针对所述动态消息的消息推送任务,从而能够及时处理推送消息,避免推送消息堆积导致不能及时推送的情形。
附图说明
一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。
图1是本发明一个实施例中动态消息推送方法的应用场景示意图;
图2是本发明动态消息推送系统的一个结构示意图;
图3是本发明动态消息推送方法的一个实施例中创建消息推送任务的流程图;
图4是本发明动态消息推送方法的一个实施例中预设时间频率、扫描时段的示意图;
图5是本发明动态消息推送方法的另一个实施例中创建消息推送任务的流程示意图;
图6是本发明动态消息推送方法的一个实施例中执行未过期的消息推送任务的流程示意图;
图7是本发明一个实施例中动态消息推送方法的详细流程图;
图8是本发明动态消息推送系统的一个实施例的结构示意图;
图9是本发明一个实施例中汽车诊断服务器的硬件结构示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
需要说明的是,如果不冲突,本发明实施例中的各个特征可以相互结合,均在本发明的保护范围之内。另外,虽然在装置示意图中进行了功能模块划分,在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于装置中的模块划分,或流程图中的顺序执行所示出或描述的步骤。再者,本发明所采用的“第一”、“第二”、“第三”等字样并不对数据和执行次序进行限定,仅是对功能和作用基本相同的相同项或相似项进行区分。本申请实施例提供的动态消息推送方法,可以应用于如图1所示的应用环境中,该应用环境包括:客户端和汽车诊断服务器。图1示例性的示出了客户端10和汽车诊断服务器20,客户端10通过网络通信连接所述汽车诊断服务器20,例如:通过局域网、广域网、无线网、全球移动通讯系统(Global System of Mobile communication,GSM)、第三代移动通信网络、第四代移动通信网络和第五代移动通信网络等方式通信连接所述汽车诊断服务器20。
其中,客户端10可以例如是专用汽车诊断设备、手机、平板电脑、个人电脑及手提电脑等。汽车诊断服务器20可以是一台服务器,例如机架式服务 器、刀片式服务器、塔式服务器或者机柜式服务器等,也可以是由若干台服务器组成的服务器集群,或者是一个云计算服务中心。
需要说明的是,本申请实施例提供的方法还可以进一步的拓展到其他合适的应用环境中,而不限于图1所示的应用环境。在实际的应用过程中,该应用环境还可以包括更多或者更少的客户端和汽车诊断服务器。汽车诊断服务器20可以实现汽车诊断、维修、保养、客户端管理等业务功能,客户端10可以与汽车诊断服务器20实现通信,以获取汽车诊断服务器20的诊断结果、维修方案等。客户端10还可以获取汽车诊断服务器20推送的动态消息,动态消息多是由汽车诊断服务器20根据业务需求即时产生的动态消息。由于动态消息的时间产生具有随机性,因此,如何处理这些动态消息,能够使其推送至客户端,称为本领域技术人员所要研究的课题。
在一种传统技术中,存在一种基于开源的高级消息延迟队列实现动态消息推送的方法。要求同一队列的消息延迟时间必须相同,否则可能会出现,先入队的消息推送时间要晚于后入队的,那么后入队的消息会被阻塞,对于延迟时间不能确定的业务场景显然是不能满足的。例如,同一队列有3条消息,分别为消息A、消息B和消息C,其中,消息A的延迟时间为5S,消息B的延迟时间为2S,消息C的延迟时间为7秒,且入队时间为消息A>消息B>消息C,此时,由于先入队的消息A的延迟时间大于消息B,导致消息A的推送时间要晚于消息B,消息B和消息C只能等到把消息A推送出去,才能进行消息推送,从而造成消息B和消息C的推送消息被阻塞,不利于消息的及时推送。
在另一种传统技术中,基于Redis(Remote Dictionary Server:远程字典服务)键过期回调提醒机制实现动态消息推送。需要打开Redis的键空间通知,比较消耗CPU,更重要的是,当Redis中同时存在大量过期键时,订阅端接收到过期提醒可能会发生较大的延迟,影响业务正常处理。例如,Redis中同时存在大量过期键A、键B、键C...键N时,Redis来不及处理大量过期键,从而导致订阅端即客户端接收到过期提醒发生较大延迟,影响业务正常处理。
针对上述问题,本申请实施例结合附图提供了如下技术方案。
如图2所示,本发明实施例提供了一种动态消息推送系统,包括业务系统、定时任务系统、消息推送系统和客户端。其中,所述业务系统和所述定时任务系统通信连接所述消息推送系统,所述消息推送系统通信连接所述客户端。所述消息推送系统从业务系统接收动态消息的推送请求,并根据推送请求对所述动态消息进行分析处理,确定动态消息的推送时间,然后判断所述推送时间是否在当前扫描时间点的扫描时段内,若是,则创建消息推送任务,在所述推送时间到达时推送所述动态消息给客户端。所述定时任务系统用于管理所有定时任务,为每个定时任务配置执行时间或者频率,当到达系统时间后,所述定时任务系统自动发出定时任务。
所述消息推送系统包括消息推送时间计算器、消息即时性校验器、消息推送记录持久层、定时任务监听器、数据库、消息推送任务生成器、缓存、内存 以及各类API(应用程序接口)接口,例如短信发送接口、邮件发送接口以及站内通知发送接口等。其中,所述消息推送时间计算器用于计算动态消息的推送时间;消息即时性校验器用于检验当前从业务系统进来的推送消息请求的推送时间是否在当前扫描时间点的扫描时段内;定时任务监听器用于对定时任务系统进行监听,当定时任务系统自动发出定时任务后,所述定时任务监听器在预设扫描时间点扫描数据库中推送时间在预设扫描时间点的扫描时段内的待推送的消息推送记录;消息推送任务生成器用于创建消息推送任务,并管理和调度消息推送任务,为消息推送任务制定执行计划等,其中,消息推送任务生成器可由线程池任务调度器(Thread Pool Task Scheduler)实现。一种实施例中,消息推送时间计算器、消息即时性校验器、定时任务监听器、消息推送任务生成器皆为软件模块。
如图3所示,本发明实施例提供了一种动态消息推送方法,所述方法应用于消息推送系统,所述方法包括:
步骤302,从业务系统接收动态消息的推送请求。
在本发明实施例中,动态消息的推送请求例如可以包括客户端的ID,业务系统可以例如为处理汽车诊断业务的系统,业务系统用于向客户端发送推送消息,提醒用户进行汽车维修、诊断、保养、向用户提供维修方案等。示例性的,当用户的的汽车距上次保养时隔3个月,此时,业务系统需要向客户端发送推送消息,提醒用户进行汽车保养。具体的,消息推送系统从业务系统接收动态消息的推送请求。
步骤304,确定所述动态消息的推送时间。
在本发明实施例中,推送时间为所述消息推送系统用于推送动态消息的时间。具体地,消息推送系统从业务系统接收到动态消息的推送请求后,基于所述推送请求确定所述动态消息的推送时间。
在本发明实施例中,动态消息的推送时间也可以理解为执行推送该动态消息任务的执行时间。
一种实现方式中,根据所述推送请求中的请求时间和预设的时间计算逻辑,计算所述动态消息的推送时间。
基于业务需求,可以预先在消息推送系统里封装常用的消息推送时间计算逻辑,例如,24小时前后、前一天等,也可以预先在所述消息推送系统里设置计算好的时间戳,所述消息推送系统根据所述推送请求中的请求时间和预先封装的时间计算逻辑,计算出所述动态消息的推送时间,从而能够统一灵活地管理消息推送时间的计算,并且能够避免相同的计算逻辑重复实现,从而提高效率。示例性的,推送请求中携带的请求时间为一个月,当前时间为2019年11月20日上午9点,可知,该推送时间是在距当前时间一个月后,由于消息推送系统里预先封装了常用的消息推送时间计算逻辑,因此,所述消息推送系统根据所述推送请求中的请求时间和预先封装的时间计算逻辑(1个月),计算出所述动态消息的推送时间为2019年12月20日上午9点。
步骤306,判断所述推送时间是否在当前扫描时间点的扫描时段内;所述当前扫描时间点属于按照预设时间频率确定的预设扫描时间点;所述扫描时段为以所述预设扫描时间点为起点的时间段,所述消息推送系统用于扫描在所述扫描时段内的至少一个推送时间。
在本发明实施例中,当计算出推送时间后,可以直接判断推送时间是否在当前扫描时间点的扫描时间段内,进而能够使动态消息的执行任务得到及时处理。
在本发明实施例中,扫描时间点是指对动态消息推送任务进行扫描的时间点,以扫描出在该时间点的扫描时段内需要执行的动态消息推送任务。扫描时间点可以是预设的,其可以按照预设时间频率确定,即相邻扫描时间点之间的时间间隔相同。其中,扫描时间段用于筛选出计划执行的动态消息任务,即筛选出推送时间在扫描时间段内的动态消息任务,消息推送系统可以进一步地计划推送时间落在扫描时间段内的动态消息任务的执行顺序,执行方式等。
其中,当前扫描时间点是指在推送时间之前的,且与推送时间最接近的一个预设扫描时间点,由于过了当前扫描时间点,则可以在计算出推送时间后,进行一次推送时间判断,即在预设扫描时间点之外对此次的动态消息进行推送时间的判断,如果该推送时间落在当前扫描时间点的扫描时段内,则可以直接处理此次动态消息,增加动态消息处理的灵活性。
在本发明实施例中,对于刚生成推送时间的动态消息任务后,可以即时地判断其推送时间是否落在当前扫描时间点的扫描时段内,则可以即时对该动态消息任务进行处理,避免了该动态消息任务被延期的状况,提升了动态消息任务的处理效率。
下面结合附图进行举例说明,如图4所示,所述预设扫描时间点为0点、2点、4点、6点和8点。所述当前扫描时间点为按照预设时间频率确定的预设扫描时间点,例如,预设时间频率为2小时扫描一次。所述扫描时段为以所述预设扫描时间点为起点的时间段,例如,0点-3点为扫描时段、2点-5点为另一个扫描时段。各扫描时间点的扫描时段可以相同,也可以不同。其中,扫描时段可以大于或等于预设时间频率,即扫描时段覆盖两个相邻扫描点之间的时间段,从而能够保证能够扫描到各推送时间,扫描时段的区间两端可以包括预设时间点,或者不包括预设时间点,当然,扫描时段的设定还可以依据扫描需求或者业务推送需求进行确定,在此不予限定。例如,如图4所示,当前扫描时间点为2点,其扫描时段为2点至5点,即扫描时段的时长为3个小时,大于预设时间频率,能够保证推送时间均被扫描到,并且各扫描时间点的扫描时段存在交叉扫描区域,能够多次确保推送时间被扫描到。当前时间为2点时,消息推送系统开启扫描程序,扫描推送时间在2点至5点的动态消息,并对扫描出的动态消息生成推送任务,对动态消息推送任务进行执行计划安排,以使各动态消息推送任务能够准时在各对应的推送时间上进行推送。对于被计划安排的动态消息推送任务,可以更改其状态,以使消息推送系统在下一个扫描时 间点,即4点,进行扫描时,可以排除已经被计划的动态消息推送任务。例如,系统在2点时扫描出推送时间在4点到5点之间的动态消息推送任务A,可以在本次扫描中,计划动态消息推送任务A的执行,该动态消息推送任务A的状态可以被更改为已计划,则系统在4点时扫描到该动态消息推送任务A时,则可以根据其状态忽略对该动态消息推送任务A的处理,进一步处理在4点时扫描出的新的推送时间在4点到5点之间的动态消息推送任务,如动态消息推送任务B。
假设当前扫描时间点为2点,在系统接收到动态消息的推送请求时,计算出该动态消息的推送时间为3点30分,可以判断3点30分落入当前扫描时间点的扫描时段(2点至5点),则可以即刻对该动态消息进行处理,如创建针对该动态消息的消息推送任务,以保证该动态消息能够在3点30分及时推送,而无需等待到下一个扫描时间点4点,进而避免该动态消息的推送时间过期,该动态消息没有得到及时处理。
假设当前扫描时间点为2点,基于上述步骤计算出的动态消息的推送时间为4点30,可以判断4点30分落入当前扫描时间点的扫描时段(2点至5点)内,则可以即时对该动态消息创建消息推送任务,由于4点30分也落在下一个预设扫描时间点4点的扫描时段(4点到7点)内,则也可以在本次不对该动态消息进行处理,将该动态消息和其推送时间记录在数据库中,以使在下一个预设扫描时间点4点时,扫描出此记录并对其进行处理。
本申请实施例既提供了周期性的扫描方式,又提供了即时性处理的方式,能够使动态消息得到及时处理,避免推送时间过期。
需要说明的是,预设扫描时间点、预设时间频率可根据业务需求自行设置,并且当前扫描时间点和扫描时段会随着预设扫描时间点和预设时间频率的不同而发生变化。
步骤308,若为是,则根据所述推送时间和所述动态消息创建针对所述动态消息的消息推送任务,所述消息推送任务用于在所述推送时间推送所述动态消息。
消息推送任务为在所述推送时间到达时,推送所述动态消息。具体地,当所述推送时间在当前扫描时间点的扫描时段内,则根据所述推送时间和所述动态消息创建针对所述动态消息的推送任务。示例性的,所述动态消息的推送时间为1点,当推送时间到达时,所述消息推送系统通过短信发送接口、邮件发送接口或者站内通知发送接口向客户端推送所述动态消息,由此能够及时处理推送消息,避免推送消息堆积导致不能及时推送的情形。
在本发明实施例中,消息推送系统从业务系统接收动态消息的推送请求,确定所述动态消息的推送时间,然后判断所述推送时间是否在当前扫描时间点的扫描时段内,若是,则根据所述推送时间和所述动态消息创建针对所述动态消息的消息推送任务,由此能够及时处理推送消息,避免推送消息堆积导致不能及时推送的情形。
在一些实施例中,如图5所示,所述方法除包括图3所示的步骤外,还包括:
步骤502,若为否,将所述推送时间和所述动态消息作为一个消息推送记录保存在数据库中。
在本发明实施例中,当判断计算出的推送时间不在当前扫描时间点的扫描时间段内时,可以先将动态消息和推送时间记录在数据库中,形成消息推送记录,所述消息推送记录包括动态消息和所述动态消息的推送时间。结合图4举例说明,所述动态消息的推送时间为6点,预设时间频率为2小时扫描一次,当前扫描时间点为2点,扫描时段为2点-5点,则认为所述推送时间(6点)不在当前扫描时间点(2点)的扫描时段(2点-5点)内,则将所述推送时间和所述动态消息作为一个消息推送记录保存在数据库中。
步骤504,在预设扫描时间点扫描出所述数据库中推送时间在所述预设扫描时间点的扫描时段内的待推送的消息推送记录。
步骤506,根据所述待推送的消息推送记录创建消息推送任务。
具体地,数据库中存储有多个消息推送记录,每个消息推送记录包括不同的推送时间和动态消息。示例性的,数据库中存在消息推送记录A、消息推送记录B、消息推送记录C,消息推送记录A的推送时间为1点,消息推送记录B的推送时间为5点,消息推送记录C的推送时间为7点,预设扫描时间点为4点,预设时间频率为2小时,扫描时段为2点-5点,可知,消息推送记录B的推送时间(5点)在预设扫描时间点(4点)的扫描时段(2点-5点)内,则在4点进行扫描时,可以确认消息推送记录B为待推送的消息推送记录,根据消息推送记录B中的动态消息和推送时间创建消息推送任务。
在一些实施例中,所述方法还包括:更新所述待推送的消息推送记录的状态,以使所述待推送的消息推送记录排除在下一个预设扫描时间点的扫描范围内。
在一些实施例中,为了保证即使消息推送系统重新部署、异常导致重启时,消息推送任务任能正常进行,需要将所述消息推送任务保存至缓存中,从而提高消息推送系统的可靠性。其中,每条消息推送任务保存在缓存中后,都会有唯一的标识,从而便于区别不同的消息推送任务。
在一些实施例中,如图6所示,所述方法除上述方法实施例中的步骤外,还包括:
步骤602,在所述消息推送系统重启后,获取所述缓存中的至少一个消息推送任务。
只要创建一条消息推送任务,缓存中就会保存该消息推送任务,当消息推送系统重启后,则会获取所述缓存中的至少一个消息推送任务。需要说明的是,仅当消息推送系统重启后,会获取一次缓存中的消息推送任务。
步骤604,按照执行计划执行所述至少一个消息推送任务中未过期的消息推送任务。
在本发明实施例中,所述执行计划是基于线程池任务调度器(Thread Pool Task Schedule)实现的,其用于按照准备时间计划各任务的执行,即制定消息推送任务的调度计划。未过期的消息推送任务是指动态消息的推送时间晚于消息推送系统的重启时间,或者获取消息任务时间的任务为未过期的任务。具体的,当消息推送系统重启后,获取缓存中的至少一个消息推送任务,并基于线程池任务调度器执行所述消息推送任务中未过期的消息推送任务。
步骤606,在所述缓存中清除所述至少一个消息推送任务中的过期的消息推送任务。
为了节约内存,当执行完消息推送任务后,清除所述缓存中的过期消息推送任务。
便于理解本发明,下面将进行具体说明:
如图7所示,首先,消息推送系统启动后,从业务系统接收动态消息的推送请求,然后根据所述推送请求中的请求时间和预先封装的时间计算逻辑,计算出所述动态消息的推送时间,接着判断所述推送时间是否在当前扫描时间点的扫描时段内,若所述推送时间在当前扫描时间点的扫描时段内,则根据所述推送时间和所述动态消息创建针对所述动态消息的推送任务,其中,为了避免漏扫推送时间为预设扫描时间点的情况,所述扫描时段的时长大于或等于所述预设时间频率的值。
具体地,假设预设扫描时间点为0点、2点、4点、6点和8点,预设时间频率为2小时扫描一次。扫描时段为以所述预设扫描时间点为起点的时间段,例如,0点-3点为预设扫描时间点0点的扫描时段、2点-5点为预设扫描时间点为2点的扫描时段。
若计算得到动态消息的推送时间为1点,判断其落在当前扫描时间点为0点的扫描时段0点-3点内,则根据所述推送时间(1点)和所述动态消息创建消息推送任务。并可以进一步计划安排该消息推送任务进行推送,当推送时间到达时,所述消息推送系统通过短信发送接口、邮件发送接口以及站内通知发送接口中的至少一个向客户端推送所述动态消息,由此能够及时处理推送消息。
进一步地,为了保证即使消息推送系统重新部署、异常导致重启时,消息推送任务任能正常进行,需要将所述消息推送任务保存至缓存中,从而提高消息推送系统的可靠性。
若所述推送时间不在当前扫描时间点的扫描时段内,则将所述推送时间和所述动态消息作为一个消息推送记录保存在数据库中。示例性的,所述动态消息的推送时间为6点,当前扫描时间点为2点,扫描时段为2点-5点,则认为所述推送时间(6点)不在当前扫描时间点(2点)的扫描时段(2点-5点)内,则将所述推送时间和所述动态消息作为一个消息推送记录保存在数据库中。数据库中存储有多个消息推送记录,每个消息推送记录包括一个推送时间和一个动态消息。示例性的,数据库中存在消息推送记录A、消息推送记录B、 消息推送记录C,消息推送记录A的推送时间为5点,消息推送记录B的推送时间为7点,消息推送记录C的推送时间为9点,预设扫描时间点为4点,则扫描时段为4点-7点,可知,消息推送记录A的推送时间(5点)在预设扫描时间点(4点)的扫描时段(4点-7点)内,则根据消息推送记录A和B分别创建消息推送任务,以使消息推送记录A中的动态消息在5点推送,消息推送记录B中的动态消息在7点推送。
进一步地,当确定消息推送记录A和B为待推送的消息推送记录后,更新消息推送记录A和B的状态,如更新为已计划或已创建任务等,以在下一个预设扫描时间点(6点)进行扫描时,排除对消息推送记录A和消息推送记录B的扫描,即消息推送记录A和B的状态表明其已经被处理,从而提高扫描效率。
进一步地,当执行完消息推送任务后,还可以更新所述消息推送记录状态,表明该条待推送消息任务已完成,同时记录消息推送历史,将所述消息推送历史和所述消息推送记录状态一并保存至数据库中,另一方面,为了节约内存,清除缓存中的所述消息推送任务。
另一种情况下,若消息推送系统故障或崩溃,在消息推送系统进行重启后,则会获取缓存中的至少一个消息推送任务,这些消息推送任务来自于根据数据库中的记录创建的消息推送任务,或者根据上述实时判断步骤创建的消息推送任务,并基于线程池任务调度器执行所述消息推送任务中未过期的消息推送任务,以保证消息推送任务最大限度的及时推送。其中,未过期的消息推送任务是指动态消息的推送时间晚于消息推送系统的重启时间,或者获取消息任务时间的任务为未过期的任务。为了节约内存,当执行完消息推送任务后,清除所述缓存中的过期消息推送任务。
相应的,本发明实施例提供了一种动态消息推送系统800,如图8所示,包括:
接收模块802,用于从业务系统接收动态消息的推送请求;
消息推送时间计算器804,用于确定所述动态消息的推送时间;
消息即时性校验器806,用于判断所述推送时间是否在当前扫描时间点的扫描时段内;所述当前扫描时间点属于按照预设时间频率确定的预设扫描时间点;所述扫描时段为以所述预设扫描时间点为起点的时间段,所述消息推送系统用于扫描在所述扫描时段内的至少一个推送时间;
消息推送任务生成器808,用于若为是,则根据所述推送时间和所述动态消息创建针对所述动态消息的消息推送任务,所述消息推送任务用于在所述推送时间推送所述动态消息。
本发明实施例提供的动态消息推送系统,通过接收模块接从业务系统接收动态消息的推送请求,通过消息推送时间计算器计算所述动态消息的推送时间,接着使用消息即时性校验器判断所述推送时间是否在当前扫描时间点的扫描时段内,若所述推送时间在当前扫描时间点的扫描时段内,则通过消息推送任务生成器根据所述推送时间和所述动态消息创建针对所述动态消息的消息 推送任务,由此能够及时处理推送消息,避免推送消息堆积导致不能及时推送的情形。
可选的,在系统的其他实施例中,如图8所示,所述系统800还包括:
保存模块810,用于若为否,将所述推送时间和所述动态消息作为一个消息推送记录保存在数据库中。
定时任务监听器812,用于在所述预设扫描时间点扫描出所述数据库中推送时间在所述预设扫描时间点的扫描时段内的待推送的消息推送记录。
可选的,在系统的其他实施例中,如图8所示,所述系统800还包括:
更新模块814,用于更新所述待推送的消息推送记录的状态,以使所述待推送的消息推送记录排除在下一个预设扫描时间点的扫描范围内。
可选的,在系统的其他实施例中,如图8所示,所述系统800还包括:
获取模块816,用于在所述消息推送系统重启后,获取所述缓存中的至少一个消息推送任务。
执行模块818,用于按照执行计划执行所述至少一个消息推送任务中未过期的消息推送任务;
清除模块820,用于在所述缓存中清除所述至少一个消息推送任务中的过期的消息推送任务。
可选的,在系统的其他实施例中,所述消息推送时间计算器804具体用于:
根据所述推送请求中的请求时间和预设的时间计算逻辑,计算所述动态消息的推送时间。
可选的,在系统的其他实施例中,所述消息推送任务生成器808具体用于:
根据所述待推送的消息推送记录创建消息推送任务。
可选的,在系统的其他实施例中,所述保存模块810具体用于:
将所述消息推送任务保存至缓存中。
需要说明的是,上述动态消息推送系统可执行本发明实施例所提供的动态消息推送方法,具备执行方法相应的功能模块和有益效果,未在动态消息推送系统实施例详尽描述的技术细节,可参考本发明实施例提供的动态消息推送方法。
图9是本发明实施例提供的汽车诊断服务器的硬件结构示意图。如图9所示,该汽车诊断服务器900包括:
一个或多个处理器902以及存储器904,图9中以一个处理器902为例。
处理器902和存储器904可以通过总线或者其他方式连接,图9中以通过总线连接为例。
存储器904作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块,如本发明实施例中的动态消息推送方法对应的程序指令/模块(例如,图8所示的接收模块802、消息推送时间计算器804、消息即时性校验器806、消息推送任务生成器808、保存模块810、定时任务监听器812、更新模块814、获取模块816、执行模块818 和清除模块820)。处理器902通过运行存储在存储器904中的非易失性软件程序、指令以及模块,从而执行汽车诊断服务器的各种功能应用以及数据处理,即实现上述方法实施例的动态消息推送方法。
存储器904可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据动态消息推送系统使用所创建的数据等。此外,存储器904可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实施例中,存储器904可选包括相对于处理器902远程设置的存储器,这些远程存储器可以通过网络连接至动态消息推送系统。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
所述一个或者多个模块存储在所述存储器904中,当被所述一个或者多个汽车诊断服务器执行时,执行上述任意方法实施例中的动态消息推送方法,例如,执行以上描述的图3中的方法步骤302至步骤308、图5中的方法步骤502至步骤506、图6中的方法步骤602至步骤606;实现图8中的模块802至820的功能。
本发明实施例还提供了一种计算机程序产品,包括存储在非易失性计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时时,使所述计算机执行:图3中的方法步骤302至步骤308、图5中的方法步骤502至步骤506、图6中的方法步骤602至步骤606。
上述产品可执行本发明实施例所提供的方法,具备执行方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,可参见本发明实施例所提供的方法。
本发明实施例的汽车诊断服务器以多种形式存在,包括但不限于:
(1)塔式服务器
一般的塔式服务器机箱和我们常用的PC机箱差不多,而大型的塔式机箱就要粗大很多,总的来说外形尺寸没有固定标准。
(2)机架式服务器
机架式服务器是由于满足企业的密集部署,形成的以19英寸机架作为标准宽度的服务器类型,高度则从1U到数U。将服务器放置到机架上,并不仅仅有利于日常的维护及管理,也可能避免意想不到的故障。首先,放置服务器不占用过多空间。机架服务器整齐地排放在机架中,不会浪费空间。其次,连接线等也能够整齐地收放到机架里。电源线和LAN线等全都能在机柜中布好线,可以减少堆积在地面上的连接线,从而防止脚踢掉电线等事故的发生。规定的尺寸是服务器的宽(48.26cm=19英寸)与高(4.445cm的倍数)。由于宽为19英寸,所以有时也将满足这一规定的机架称为“19英寸机架”。
(3)刀片式服务器
刀片服务器是一种HAHD(High Availability High Density,高可用高 密度)的低成本服务器平台,是专门为特殊应用行业和高密度计算机环境设计的,其中每一块“刀片”实际上就是一块系统母板,类似于一个个独立的服务器。在这种模式下,每一个母板运行自己的系统,服务于指定的不同用户群,相互之间没有关联。不过可以使用系统软件将这些母板集合成一个服务器集群。在集群模式下,所有的母板可以连接起来提供高速的网络环境,可以共享资源,为相同的用户群服务。
(4)云服务器
云服务器(Elastic Compute Service,ECS)是一种简单高效、安全可靠、处理能力可弹性伸缩的计算服务。其管理方式比物理服务器更简单高效,用户无需提前购买硬件,即可迅速创建或释放任意多台云服务器。云服务器的分布式存储用于将大量服务器整合为一台超级计算机,提供大量的数据存储和处理服务。分布式文件系统、分布式数据库允许访问共同存储资源,实现应用数据文件的IO共享。虚拟机可以突破单个物理机的限制,动态的资源调整与分配消除服务器及存储设备的单点故障,实现高可用性。
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
通过以上的实施方式的描述,本领域普通技术人员可以清楚地了解到各实施方式可借助软件加通用硬件平台的方式来实现,当然也可以通过硬件。本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读
存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;在本发明的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,步骤可以以任意顺序实现,并存在如上所述的本发明的不同方面的许多其它变化,为了简明,它们没有在细节中提供;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims (10)

  1. 一种动态消息推送方法,其特征在于,所述方法应用于消息推送系统,所述方法包括:
    从业务系统接收动态消息的推送请求;
    确定所述动态消息的推送时间;
    判断所述推送时间是否在当前扫描时间点的扫描时段内;所述当前扫描时间点属于按照预设时间频率确定的预设扫描时间点;所述扫描时段为以所述预设扫描时间点为起点的时间段,所述消息推送系统用于扫描在所述扫描时段内的至少一个推送时间;
    若为是,则根据所述推送时间和所述动态消息创建针对所述动态消息的消息推送任务,所述消息推送任务用于在所述推送时间推送所述动态消息。
  2. 根据权利要求1所述的方法,其特征在于,所述扫描时段的时长大于或等于所述预设时间频率的值。
  3. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:
    若为否,将所述推送时间和所述动态消息作为一个消息推送记录保存在数据库中;
    在所述预设扫描时间点扫描出所述数据库中推送时间在所述预设扫描时间点的扫描时段内的待推送的消息推送记录;
    根据所述待推送的消息推送记录创建消息推送任务。
  4. 根据权利要求3所述的方法,其特征在于,所述方法还包括:
    更新所述待推送的消息推送记录的状态,以使所述待推送的消息推送记录排除在下一个预设扫描时间点的扫描范围内。
  5. 根据权利要求1-4任一项所述的方法,其特征在于,所述方法还包括:
    将所述消息推送任务保存至缓存中。
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:
    在所述消息推送系统重启后,获取所述缓存中的至少一个消息推送任务;
    按照执行计划执行所述至少一个消息推送任务中未过期的消息推送任务;
    在所述缓存中清除所述至少一个消息推送任务中的过期的消息推送任务。
  7. 根据权利要求1-6任一项所述的方法,其特征在于,所述确定所述动态消息的推送时间,包括:
    根据所述推送请求中的请求时间和预设的时间计算逻辑,计算所述动态消息的推送时间。
  8. 一种动态消息推送系统,其特征在于,包括:
    接收模块,用于从业务系统接收动态消息的推送请求;
    消息推送时间计算器,用于确定所述动态消息的推送时间;
    消息即时性校验器,用于判断所述推送时间是否在当前扫描时间点的扫描时段内;所述当前扫描时间点属于按照预设时间频率确定的预设扫描时间点; 所述扫描时段为以所述预设扫描时间点为起点的时间段,所述消息推送系统用于扫描在所述扫描时段内的至少一个推送时间;
    消息推送任务生成器,用于若为是,则根据所述推送时间和所述动态消息创建针对所述动态消息的消息推送任务,所述消息推送任务用于在所述推送时间推送所述动态消息。
  9. 一种汽车诊断服务器,其特征在于,包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-7任一项所述的方法。
  10. 一种非易失性计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机可执行指令,当所述计算机可执行指令被处理器所执行时,使所述处理器执行如权利要求1-7任一项所述的方法。
PCT/CN2020/130607 2019-11-27 2020-11-20 一种动态消息推送方法、系统和汽车诊断服务器 WO2021104178A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911182311.3A CN111225029A (zh) 2019-11-27 2019-11-27 一种动态消息推送方法、系统和汽车诊断服务器
CN201911182311.3 2019-11-27

Publications (1)

Publication Number Publication Date
WO2021104178A1 true WO2021104178A1 (zh) 2021-06-03

Family

ID=70827734

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/130607 WO2021104178A1 (zh) 2019-11-27 2020-11-20 一种动态消息推送方法、系统和汽车诊断服务器

Country Status (2)

Country Link
CN (1) CN111225029A (zh)
WO (1) WO2021104178A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114154044A (zh) * 2021-11-10 2022-03-08 创优数字科技(广东)有限公司 消息推送方法、装置、计算机设备和存储介质
CN114510337A (zh) * 2022-04-15 2022-05-17 深圳美云集网络科技有限责任公司 任务执行方法、系统及计算机可读存储介质

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111225029A (zh) * 2019-11-27 2020-06-02 深圳市道通科技股份有限公司 一种动态消息推送方法、系统和汽车诊断服务器
CN111881390A (zh) * 2020-06-08 2020-11-03 长沙市到家悠享网络科技有限公司 信息处理方法、装置、设备和存储介质
CN112959860B (zh) * 2021-03-09 2022-07-19 深圳市道通科技股份有限公司 一种胎压传感器信息处理方法、装置及设备
CN113220699A (zh) * 2021-06-10 2021-08-06 国泰君安证券股份有限公司 支持多模式敏捷型资讯数据接发的系统及其方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103747092A (zh) * 2014-01-17 2014-04-23 深圳市凯伦圣科技有限公司 一种汽车售后管理系统和方法
CN105491115A (zh) * 2015-11-25 2016-04-13 努比亚技术有限公司 消息推送装置及方法
WO2018032176A1 (zh) * 2016-08-14 2018-02-22 阮元 一种根据用户使用习惯调整信息推送技术的方法及服务器
CN111225029A (zh) * 2019-11-27 2020-06-02 深圳市道通科技股份有限公司 一种动态消息推送方法、系统和汽车诊断服务器

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104660482A (zh) * 2013-11-20 2015-05-27 中兴通讯股份有限公司 一种社交网络信息推送方法及装置
CN106161593B (zh) * 2016-06-21 2020-02-07 北京奇虎科技有限公司 消息轮询方法和服务器、通信系统
US10643039B2 (en) * 2016-08-04 2020-05-05 Industrial Technology Research Institute Location based situation awareness system and method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103747092A (zh) * 2014-01-17 2014-04-23 深圳市凯伦圣科技有限公司 一种汽车售后管理系统和方法
CN105491115A (zh) * 2015-11-25 2016-04-13 努比亚技术有限公司 消息推送装置及方法
WO2018032176A1 (zh) * 2016-08-14 2018-02-22 阮元 一种根据用户使用习惯调整信息推送技术的方法及服务器
CN111225029A (zh) * 2019-11-27 2020-06-02 深圳市道通科技股份有限公司 一种动态消息推送方法、系统和汽车诊断服务器

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114154044A (zh) * 2021-11-10 2022-03-08 创优数字科技(广东)有限公司 消息推送方法、装置、计算机设备和存储介质
CN114510337A (zh) * 2022-04-15 2022-05-17 深圳美云集网络科技有限责任公司 任务执行方法、系统及计算机可读存储介质
CN114510337B (zh) * 2022-04-15 2023-03-21 深圳美云集网络科技有限责任公司 任务执行方法、系统及计算机可读存储介质

Also Published As

Publication number Publication date
CN111225029A (zh) 2020-06-02

Similar Documents

Publication Publication Date Title
WO2021104178A1 (zh) 一种动态消息推送方法、系统和汽车诊断服务器
CN108388479B (zh) 延迟消息推送方法、装置、计算机设备及存储介质
US10169060B1 (en) Optimization of packet processing by delaying a processor from entering an idle state
CN108449410B (zh) 一种云平台中消息管理方法、系统及相关装置
CN108566290B (zh) 服务配置管理方法、系统、存储介质和服务器
CN107241281B (zh) 一种数据处理方法及其装置
CN112118315A (zh) 数据处理系统、方法、装置、电子设备和存储介质
US10237224B2 (en) Context aware serialization
CN112579304A (zh) 基于分布式平台的资源调度方法、装置、设备及介质
CN112328448A (zh) 基于Zookeeper的监控方法、监控装置、设备及存储介质
CN112751847A (zh) 接口调用请求的处理方法、装置、电子设备及存储介质
CN109257396B (zh) 一种分布式锁调度方法及装置
US10970143B1 (en) Event action management mechanism
CN111586140A (zh) 一种数据交互的方法及服务器
CN109388501B (zh) 基于人脸识别请求的通信匹配方法、装置、设备及介质
CN112860387A (zh) 分布式任务调度方法、装置、计算机设备及存储介质
CN114844809A (zh) 基于网络心跳和内核磁盘心跳的多因子仲裁方法、装置
US10042414B2 (en) Concurrent network application scheduling for reduced power consumption
CN112600842A (zh) 集群shell方法、装置、电子设备及计算机可读存储介质
US9990240B2 (en) Event handling in a cloud data center
CN111274047A (zh) 信息处理方法、终端、系统、计算机设备和存储介质
WO2023142824A1 (zh) Gpu资源利用率的监控方法、装置、计算机设备及介质
CN111797352A (zh) 封禁帐号的方法、装置及封禁系统
CN116010065A (zh) 分布式任务调度方法、装置以及设备
CN110912949A (zh) 位点提交方法和装置

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: 20893052

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20893052

Country of ref document: EP

Kind code of ref document: A1