Service processing method and device
By storing high-frequency altered data into system memory and reducing remote process calls, and selecting the latest data for business processing in combination with the generation time comparison, the problem of unstable performance of the business system and excessive pressure to rely on the system interface in the existing technology is solved, and the real-time and accuracy of the data are achieved.
Patent Information
- Application Number
- CN202311745275.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-18
- Publication Date
- 2025-06-20
AI Technical Summary
In the prior art, when RPC is used to obtain high-frequency variable data in real time, problems such as poor performance and network jitter are prone to occur, resulting in unstable performance of the service system interface, which puts huge pressure on the interfaces that depend on the system and seriously affects performance.
Store high-frequency changed data into system memory, obtain data from system memory during business processing, reduce or avoid remote process calls, and add generation time to the data, select the latest data through generation time comparison for business processing.
It solves the problem of unstable performance of business systems and excessive pressure to rely on system interfaces, ensures the performance of business systems and dependent systems, and ensures the real-time and accuracy of data.
Smart Images

Figure CN120179685A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular, to a method and apparatus for business processing. Background Art
[0002] Currently, when conducting business processing, for data such as user points and user available quotas that change frequently, it is usually necessary to use the RPC (Remote Procedure Call) method to request the management system of the corresponding frequently changing data in real time to obtain the real-time data of the user for logical processing.
[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0004] Using the RPC method to obtain data in real time will result in poor performance, network jitter, etc., causing the performance of the business system interface to be unstable, and bringing great pressure to the interfaces of the dependent systems, seriously affecting the performance of the business system and the dependent systems. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide a method and apparatus for business processing, which can store frequently changed data in the system memory, and obtain data from the system memory when conducting business processing, reducing or avoiding remote procedure calls, so as to solve the problems of unstable performance of the business system and excessive interface pressure of the dependent systems in the existing solutions, thereby ensuring the performance of the business system and the dependent systems. At the same time, by adding a generation time to the frequently changed data, comparing the generation times of the first stored data obtained by processing the data change message and the second stored data obtained by processing the data pulled from the data storage system, and selecting the data with a later generation time for business processing, thereby ensuring the timeliness and accuracy of the data and the accuracy of the business processing results.
[0006] To achieve the above object, according to one aspect of the embodiments of the present invention, a method for business processing is provided, including:
[0007] Obtaining first stored data and second stored data from the system memory according to the data identifier included in the business processing request, where the first stored data is obtained by processing the change message of the data corresponding to the data identifier, the second stored data is obtained by processing the data corresponding to the data identifier pulled from the data storage system in advance, and both the first stored data and the second stored data have a generation time, and the data corresponding to the data identifier is data whose change frequency exceeds a set threshold;
[0008] Select the data with a later generation time as the target data corresponding to the data identifier according to the generation times of the first stored data and the second stored data;
[0009] Use the target data for business processing.
[0010] Optionally, the first stored data is in the form of key-value pairs, and the second stored data is in a compressed format.
[0011] Optionally, the change message of the data corresponding to the data identifier is generated and sent by the data storage system when the data corresponding to the data identifier changes; the processing of the data corresponding to the data identifier pre-pulled from the data storage system includes: determining the category to which the data corresponding to the data identifier pre-pulled from the data storage system belongs according to a classification rule for data classification; performing data compression processing on the classified data.
[0012] Optionally, the data compression processing is implemented by performing a hash operation on the data.
[0013] Optionally, the data compression processing is implemented based on a Bloom filter or a Cuckoo filter.
[0014] Optionally, the second stored data is obtained by processing the data periodically pulled from the data storage system, and after the second stored data is obtained by processing the data pulled from the data storage system each time, the existing second stored data in the system memory is replaced with the processed second stored data.
[0015] Optionally, the method further includes: periodically obtaining the first stored data and the second stored data corresponding to each data identifier to be compared from the system memory; for each data identifier to be compared, determining the data to be deleted according to the generation time of the first stored data corresponding to the data identifier to be compared and the generation time of the second stored data corresponding to the data identifier to be compared; deleting the data to be deleted to clean up the system memory.
[0016] According to another aspect of the embodiments of the present invention, there is provided an apparatus for business processing, including:
[0017] A data acquisition module, configured to acquire first stored data and second stored data from the system memory according to a data identifier included in a business processing request, where the first stored data is obtained by processing a change message of the data corresponding to the data identifier, the second stored data is obtained by processing the data corresponding to the data identifier pre-pulled from a data storage system, and both the first stored data and the second stored data have a generation time;
[0018] A version comparison module, configured to select the data with a later generation time as the target data corresponding to the data identifier according to the generation times of the first stored data and the second stored data;
[0019] A service processing module, configured to perform service processing using the target data.
[0020] According to another aspect of the embodiments of the present invention, an electronic device is provided, including: one or more processors; a storage device, configured to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the service processing method provided by the embodiments of the present invention.
[0021] According to still another aspect of the embodiments of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the service processing method provided by the embodiments of the present invention is implemented.
[0022] One embodiment of the above invention has the following advantages or beneficial effects: By obtaining the first stored data and the second stored data from the system memory according to the data identifier included in the service processing request, the first stored data is obtained by processing the change message of the data corresponding to the data identifier, the second stored data is obtained by processing the data corresponding to the data identifier pre-pulled from the data storage system, and both the first stored data and the second stored data have a generation time, and the data corresponding to the data identifier is data with a change frequency exceeding a set threshold; According to the generation times of the first stored data and the second stored data, select the data with a later generation time as the target data corresponding to the data identifier; The technical solution of using the target data for service processing stores the frequently changed data in the system memory, and obtains the data from the system memory when performing service processing, reducing or avoiding remote procedure calls, so as to solve the problems of unstable performance of the service system and excessive interface pressure on the dependent system in the existing solutions, thereby ensuring the performance of the service system and the dependent system. At the same time, by adding a generation time to the frequently changed data, comparing the generation times of the first stored data obtained by processing the data change message and the second stored data obtained by processing the data pulled from the data storage system, and selecting the data with a later generation time for service processing, thereby ensuring the timeliness and accuracy of the data and the accuracy of the service processing result.
[0023] The further effects of the above non-conventional optional manners will be described in combination with specific embodiments below. Description of the Drawings
[0024] The drawings are used to better understand the present invention and do not constitute an improper limitation to the present invention. Among them:
[0025] Figure 1 is a schematic diagram of the main steps of the service processing method according to an embodiment of the present invention;
[0026] Figure 2 is a schematic diagram of the data processing flow according to an embodiment of the present invention;
[0027] Figure 3 is a schematic diagram of the system memory cleaning process according to an embodiment of the present invention;
[0028] Figure 4 is a schematic diagram of the service processing flow according to an embodiment of the present invention;
[0029] Figure 5 is a schematic diagram of the system interaction process according to an embodiment of the present invention;
[0030] Figure 6 is a schematic diagram of the main modules of the service processing device according to an embodiment of the present invention;
[0031] Figure 7 is an exemplary system architecture diagram to which the embodiments of the present invention can be applied;
[0032] Figure 8 is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing the embodiments of the present invention. Detailed implementation manners
[0033] The following describes exemplary embodiments of the present invention with reference to the accompanying drawings. Various details of the embodiments of the present invention are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, descriptions of well-known functions and structures are omitted below for clarity and conciseness.
[0034] It should be noted that in the technical solutions disclosed in the present invention, in terms of the collection, collection, update, analysis, processing, use, transmission, storage, etc. of user personal information, they all comply with the provisions of relevant laws and regulations, are used for legal purposes, and do not violate public order and good customs. Necessary measures are taken for user personal information to prevent illegal access to user personal information data, and to safeguard user personal information security, network security, and national security.
[0035] Taking the user points or credit limit on an e-commerce platform as an example of high-frequency changing data, when a user purchases a certain product, only users with user points (or credit limit) greater than 500 can make the purchase; when a user pays with points, the user's points will be deducted accordingly, when the user confirms receipt of the goods, the user will obtain corresponding points, and when the user requests a refund, the points will be restored. When a certain user logs in to the e-commerce platform to shop, to determine whether the user can purchase product A, it is necessary to call a remote interface - the points system via the RPC method to obtain the user's current latest points, determine whether it is sufficient, and display the business processing result according to the points situation. In the case of high concurrency, the interface pressure of the points system is the same as that of the business system, and the performance of the business system is directly related to the points system. When there are situations such as poor performance and network jitter, it will cause the performance of the business system interface to be unstable, and will bring great pressure to the points system interface, seriously affecting the performance of the business system and the points system; at the same time, when multiple services rely on this points system, once the points system interface fails, it will be a very big disaster.
[0036] To solve the above problems existing in the prior art, the present invention provides a method and device for business processing, by locally storing in memory the high-frequency changing data of users, reducing or avoiding remote procedure calls, so as to solve the problems of poor performance and excessive pressure on the interface provider existing in the existing solutions.
[0037] Figure 1 It is a schematic diagram of the main steps of the method for business processing according to an embodiment of the present invention. As Figure 1 shown, the method for business processing according to the embodiment of the present invention mainly includes the following steps S101 to step S103.
[0038] Step S101: Obtain first stored data and second stored data from the system memory according to the data identifier included in the business processing request. The first stored data is obtained by processing the change message of the data corresponding to the data identifier, and the second stored data is obtained by processing the data corresponding to the data identifier pre-pulled from the data storage system. Both the first stored data and the second stored data have a generation time, and the data corresponding to the data identifier is data with a change frequency exceeding a set threshold;
[0039] Step S102: According to the generation times of the first stored data and the second stored data, select the data with the later generation time as the target data corresponding to the data identifier;
[0040] Step S103: Use the target data for business processing.
[0041] Through the above steps S101 to S103, the data with high-frequency changes can be stored in the system memory, and when business processing is performed, the data is obtained from the system memory, reducing or avoiding remote procedure calls, so as to solve the problems of unstable performance of the business system and excessive interface pressure on the dependent system in the existing solutions, thereby ensuring the performance of the business system and the dependent system. At the same time, by adding a generation time to the data with high-frequency changes, comparing the generation times of the first stored data obtained by processing the data change message and the second stored data obtained by processing the data pulled from the data storage system, and selecting the data with a later generation time for business processing, thereby ensuring the timeliness and accuracy of the data and the accuracy of the business processing result.
[0042] According to an embodiment of the present invention, the data with a change frequency exceeding a set threshold is, for example, data with high-frequency changes such as user points and user available credit generated in the business system. Each time business processing needs to be performed based on these high-frequency changed data, the latest generated data needs to be obtained. According to an embodiment of the present invention, the first stored data is in the form of key-value pairs, and the second stored data is in a compressed format. Among them, the change message of the data corresponding to the data identifier is generated and sent by the data storage system when the data corresponding to the data identifier changes. In the embodiment of the present invention, the data corresponding to the data identifier is data with a change frequency exceeding a set threshold, and it can be basically considered that it changes at all times. Therefore, in order to facilitate obtaining the latest generated data, a version number can be set for the data, and the version number is incremented by 1 each time it changes, and the latest generated data is determined according to the version number. For example, at 17:00 on February 6, 2023, the data changed, and the version number was 1. At 17:01 on February 6, 2023, the data changed again, and its version number was 2. Each time the data changes in the data storage system, a change message is triggered to be generated and sent to the business system for the business system to use during business processing, and at the same time, the changed data is also stored. At this time, whether it is the data stored in the data storage system or the change message sent to the business system, the data has a version number.
[0043] After parsing the received data change message, the business system stores it in the system memory in the form of key-value pairs. For example, taking user points as an example, the storage format is zhangsan-500 points-V1, indicating that the user is zhangsan, the current points are 500 points, and the version number is V1. Among them, using the user identifier (such as zhangsan) as the key name, and the point value and version number as the key values, it is stored in the system memory in the form of key-value pairs.
[0044] For the data stored in the data storage system, the data storage system provides an interface for the business system or other systems to call. Here, the data storage system is, for example, an integral management system, a quota management system, etc.
[0045] According to an embodiment of the present invention, the processing of the data corresponding to the data identifier pre-pulled from the data storage system includes: determining the category to which the data corresponding to the data identifier pre-pulled from the data storage system belongs according to a classification rule to perform data classification; performing data compression processing on the classified data.
[0046] In an embodiment of the present invention, the business system or other systems can regularly pull data from the data storage system through the interface provided by the data storage system, then classify the pulled data according to the pre-set data classification rules, and then perform data compression processing on the classified data. The purpose of performing data compression processing is to facilitate transmission and storage when there are many users. When the number of users is very large, such as hundreds of millions, in this case, the uncompressed data cannot be stored in the business system, so it is necessary to classify the user data and then store it. Taking user points as an example, for example, if the total points range from 500 to 1000, then all users can be divided into 500 parts according to user points, and the user data corresponding to each part of points is stored. For example, the user data of all users with a points value of 500 can be stored together, and the user data of all users with a points value of 501 can be stored together. Usually, since the data volume corresponding to the high-frequency changing data is very large, these data can be compressed to save storage space and improve transmission efficiency.
[0047] In an embodiment of the present invention, the data compression processing is implemented by performing a hash operation on the data. When performing data compression, the data can be hashed through a hash algorithm to perform data compression processing. Among them, the data compression processing is based on a Bloom filter or a Cuckoo filter. A Bloom filter (BloomFilter) is actually a very long binary vector and a series of random mapping functions, which can be used to retrieve whether an element is in a set. Its advantage is that both the space efficiency and the query time are much better than general algorithms. The Cuckoo filter can be said to be an enhanced version of the Bloom filter, which can delete elements, has a higher query efficiency, and a higher space utilization rate. Performing data compression processing through a Bloom filter or a Cuckoo filter can also facilitate data query.
[0048] Figure 2 is a schematic diagram of the data processing flow of an embodiment of the present invention. As Figure 2As shown, a business system or other system can use a timing scheduler to regularly pull data from a data storage system through an interface provided by the data storage system. After regularly pulling data from the data storage system, the data will be classified to obtain multiple data sets; then, for each data set, a Bloom filter will be used to perform data compression processing to complete data processing.
[0049] In one embodiment of the present invention, the second stored data is obtained by processing the data regularly pulled from the data storage system. And each time after processing the data pulled from the data storage system to obtain the second stored data, the obtained second stored data is used to replace the second stored data already existing in the system memory. Each time after pulling data from the data storage system, the pulled data is processed and saved, and then the old version of the data is deleted from the system memory to ensure the uniqueness of the processed data in the system memory. In the embodiments of the present invention, a business system or other system can regularly pull data from the data storage system through an interface provided by the data storage system, then classify the pulled data according to pre-set data classification rules, and then perform data compression processing on the classified data to obtain the second stored data. Taking user points as an example, for instance, if the total points range from 500 to 1000, then all users can be divided into 500 parts according to their user points, and the user data corresponding to each part is stored. For example, the user data of all users with a points value of 500 can be stored together, and the user data of all users with a points value of 501 can be stored together. Generally, since the data volume corresponding to highly variable data is very large, the data can be compressed to obtain the second stored data, which can save storage space and facilitate improving the transmission efficiency.
[0050] After obtaining the second stored data, the obtained second stored data will be used to replace the second stored data that has already existed in the system memory before, that is: the new version of the second stored data is used to replace the old version of the second stored data to ensure the uniqueness of the second stored data in the system memory.
[0051] According to another embodiment of the present invention, the method for business processing may further include: periodically obtaining from the system memory the first stored data and the second stored data corresponding to each data identifier to be compared; for each of the data identifiers to be compared, determining the data to be deleted according to the generation time of the first stored data corresponding to the data identifier to be compared and the generation time of the second stored data corresponding to the data identifier to be compared; and deleting the data to be deleted to clean the system memory. Herein, a data identifier may uniquely identify and recognize a piece of data. For example, the data identifier may be information with global uniqueness such as a user name, a user ID (identity document), a user account, etc.
[0052] Since new data change messages will continuously arrive in the system memory and the compression data update will be continuously performed by the periodic task, a periodic task for memory cleaning is required to prevent the data volume in the system memory from being too large, resulting in data overflow or data loss. Specifically, when cleaning the system memory, each data identifier in the system memory is used as the data identifier to be compared, and then the key-value pair format data (the first stored time) and the compressed format data (the second stored data) corresponding to the data identifier to be compared are obtained. Then, the version number of the key-value pair format data is compared with the version number of the compressed format data, and the data with the older version (i.e., the earlier generation time) is deleted from the system memory to achieve this. Herein, among the data corresponding to the same data identifier, the data with the smaller version number (i.e., the earlier generation time) is deleted.
[0053] Figure 3 It is a schematic diagram of the system memory cleaning process according to an embodiment of the present invention. As Figure 3 shown, when the periodic task is triggered to execute, first, the key-value pair format data and the compressed format data corresponding to each data identifier to be compared are obtained from the system memory; then, subsequent comparison processing is respectively performed for each data identifier to be compared, specifically including: obtaining the version number of the key-value pair format data, and then obtaining the version number of the compressed format data; after that, the two version numbers are compared, and the data corresponding to the smaller version number (i.e., the earlier generation time) is used as the data to be deleted; finally, the data to be deleted is deleted to perform memory cleaning.
[0054] Figure 4It is a schematic diagram of the service processing flow of an embodiment of the present invention. In this embodiment, the high-frequency changing data is taken as an example of user points. When the service system processes business logic, it needs to obtain the point data of a certain user. The point data of this user may exist in the key-value pair format data pool and the compressed data pool in the memory at the same time. Therefore, the first stored data in the key-value pair format corresponding to this user and the second stored data in the compressed format will be obtained from the system memory, and the version numbers of the first stored data and the second stored data will be obtained; then, the version numbers of the first stored data and the second stored data will be compared to obtain the data with the larger version number (i.e., the later generation time) as the target point data of this user; after that, the target point data will be used to perform business logic processing to obtain the service processing result.
[0055] Figure 5 It is a schematic diagram of the system interaction process of an embodiment of the present invention. In the embodiment of the present invention, the high-frequency changing data is taken as an example of user points. The data interaction mainly includes the data interaction among the service system, the task system, and the point system during the service processing. Among them:
[0056] The task system is used to regularly query the interface of the point system through the timing scheduler, obtain the point data of all users, and perform data classification and data compression;
[0057] The point system is mainly used to store user point data, and generate a data change message and send it to the service system when the points change;
[0058] The service system is used to regularly pull the compressed format data from the task system after the service is started, and process the received data change message to generate data in the key-value pair format. When performing business processing, the data in the key-value pair format and the compressed format are obtained from the system memory through business logic, and the data version is compared to determine the target data, and the target data is used to perform business logic processing to obtain the service processing result. And the system memory is also cleared through the set timing task.
[0059] Figure 6 It is a schematic diagram of the main modules of the service processing device according to the embodiment of the present invention. As Figure 6 shown, the service processing device 600 of the embodiment of the present invention mainly includes a data acquisition module 601, a version comparison module 602, and a service processing module 603.
[0060] A data acquisition module 601, configured to obtain first stored data and second stored data from the system memory according to a data identifier included in a service processing request, where the first stored data is obtained by processing a change message of data corresponding to the data identifier, the second stored data is obtained by processing data corresponding to the data identifier pulled from a data storage system in advance, and both the first stored data and the second stored data have a generation time;
[0061] A version comparison module 602, configured to select the data with a later generation time as the target data corresponding to the data identifier according to the generation times of the first stored data and the second stored data;
[0062] A service processing module 603, configured to perform service processing using the target data.
[0063] According to an embodiment of the present invention, the first stored data is in the format of key-value pairs, and the second stored data is in a compressed format.
[0064] According to another embodiment of the present invention, the change message of the data corresponding to the data identifier is generated and sent by the data storage system when the data corresponding to the data identifier changes. The processing of the data corresponding to the data identifier pulled from the data storage system in advance specifically may include: determining the category to which the data corresponding to the data identifier pulled from the data storage system in advance belongs according to a classification rule for data classification; performing data compression processing on the classified data.
[0065] According to still another embodiment of the present invention, the data compression processing is implemented by performing a hash operation on the data.
[0066] According to still another embodiment of the present invention, the data compression processing is implemented based on a Bloom filter or a Cuckoo filter.
[0067] According to still another embodiment of the present invention, the second stored data is obtained by processing data pulled from the data storage system at regular intervals, and after each time the data pulled from the data storage system is processed to obtain the second stored data, the second stored data obtained by the processing is used to replace the second stored data already existing in the system memory.
[0068] According to another embodiment of the present invention, the service processing device 600 further includes a memory cleaning module (not shown in the figure), which is configured to: regularly obtain the first stored data and the second stored data corresponding to each data identifier to be compared from the system memory; for each data identifier to be compared, determine the data to be deleted according to the generation time of the first stored data corresponding to the data identifier to be compared and the generation time of the second stored data corresponding to the data identifier to be compared; and delete the data to be deleted to clean the system memory.
[0069] According to the technical solution of the embodiment of the present invention, by obtaining the first stored data and the second stored data from the system memory according to the data identifier included in the service processing request, the first stored data is obtained by processing the change message of the data corresponding to the data identifier, the second stored data is obtained by processing the data corresponding to the data identifier pre-pulled from the data storage system, and both the first stored data and the second stored data have a generation time, and the data corresponding to the data identifier is data with a change frequency exceeding a set threshold; according to the generation times of the first stored data and the second stored data, select the data with a later generation time as the target data corresponding to the data identifier; and use the target data for service processing. By storing the frequently changed data in the system memory and obtaining the data from the system memory when performing service processing, the remote procedure call is reduced or avoided, so as to solve the problems of unstable performance of the service system and excessive interface pressure on the dependent system in the existing solution, thereby ensuring the performance of the service system and the dependent system. At the same time, by adding a generation time to the frequently changed data, comparing the generation times of the first stored data obtained by processing the data change message and the second stored data obtained by processing the data pulled from the data storage system, and selecting the data with a later generation time for service processing, the real-time and accuracy of the data are ensured, and the accuracy of the service processing result is ensured.
[0070] Figure 7 An exemplary system architecture 700 to which the method for service processing or the service processing device according to the embodiment of the present invention can be applied is shown.
[0071] As Figure 7 shown, the system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 is used to provide a medium for a communication link between the terminal devices 701, 702, 703 and the server 705. The network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0072] Users can use terminal devices 701, 702, and 703 to interact with server 705 via network 704 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 701, 702, and 703, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (for example only).
[0073] Terminal devices 701, 702, and 703 can be various electronic devices with a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop portable computers, and desktop computers, etc.
[0074] Server 705 can be a server that provides various services, such as a background management server that supports shopping websites browsed by users using terminal devices 701, 702, and 703 (for example only). The background management server can obtain first stored data and second stored data from the system memory according to the data identifier included in the received service processing request and other data. The first stored data is obtained by processing the change message of the data corresponding to the data identifier, and the second stored data is obtained by processing the data corresponding to the data identifier pulled from the data storage system in advance. Both the first stored data and the second stored data have a generation time, and the data corresponding to the data identifier is data with a change frequency exceeding a set threshold; according to the generation times of the first stored data and the second stored data, select the data with the later generation time as the target data corresponding to the data identifier; use the target data for service processing and other processing, and feedback the processing result (such as a service processing result - for example only) to the terminal device.
[0075] It should be noted that the method for service processing provided by the embodiments of the present invention is generally executed by server 705. Correspondingly, the device for service processing is generally arranged in server 705.
[0076] It should be understood, Figure 7 The numbers of terminal devices, networks, and servers in
[0077] are merely illustrative. According to actual needs, there can be any number of terminal devices, networks, and servers. Figure 8 Shown below with reference to Figure 8 is a schematic structural diagram of a computer system 800 of a terminal device or a server suitable for implementing the embodiments of the present invention.
[0078] As shown in Figure 8As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded into the random access memory (RAM) 803 from the storage section 808. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0079] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed so that a computer program read from it can be installed into the storage section 808 as needed.
[0080] Specifically, according to the embodiments disclosed in the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from the network via the communication section 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above functions defined in the system of the present invention are executed.
[0081] It should be noted that the computer-readable medium shown in the present invention can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0082] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks can occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0083] The units or modules involved in the embodiments of the present invention can be implemented in software or in hardware. The described units or modules can also be provided in a processor. For example, it can be described as: a processor includes a data acquisition module, a version comparison module, and a service processing module. Among them, the names of these units or modules do not constitute a limitation on the units or modules themselves in some cases. For example, the service processing module can also be described as "a module for performing service processing using the target data".
[0084] As another aspect, the present invention also provides a computer-readable medium. The computer-readable medium can be included in the device described in the above embodiments; or it can exist alone without being assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by the device, the device includes: obtaining first stored data and second stored data from the system memory according to the data identifier included in the service processing request, where the first stored data is obtained by processing the change message of the data corresponding to the data identifier, the second stored data is obtained by processing the data corresponding to the data identifier pre-pulled from the data storage system, and both the first stored data and the second stored data have a generation time, and the data corresponding to the data identifier is data with a change frequency exceeding a set threshold; selecting the data with a later generation time as the target data corresponding to the data identifier according to the generation times of the first stored data and the second stored data; and performing service processing using the target data.
[0085] According to the technical solution of the embodiment of the present invention, by obtaining the first stored data and the second stored data from the system memory according to the data identifier included in the service processing request, the first stored data is obtained by processing the change message of the data corresponding to the data identifier, the second stored data is obtained by processing the data corresponding to the data identifier pre-pulled from the data storage system, and both the first stored data and the second stored data have a generation time, and the data corresponding to the data identifier is data with a change frequency exceeding a set threshold; according to the generation times of the first stored data and the second stored data, select the data with the later generation time as the target data corresponding to the data identifier; the technical solution of using the target data for service processing, by storing the data with high-frequency changes in the system memory and obtaining the data from the system memory when performing service processing, reduces or avoids remote procedure calls, so as to solve the problems of unstable performance of the service system and excessive interface pressure on the dependent system in the existing solution, thereby ensuring the performance of the service system and the dependent system. At the same time, by adding a generation time to the data with high-frequency changes, comparing the generation times of the first stored data obtained by processing the data change message and the second stored data obtained by processing the data pulled from the data storage system, and selecting the data with the later generation time for service processing, thereby ensuring the timeliness and accuracy of the data and the accuracy of the service processing result.
[0086] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for business processing, characterized in that, Including: Obtain first stored data and second stored data from the system memory according to the data identifier included in the service processing request. The first stored data is obtained by processing the change message of the data corresponding to the data identifier. The second stored data is obtained by processing the data corresponding to the data identifier pulled from the data storage system in advance. Both the first stored data and the second stored data have a generation time, and the data corresponding to the data identifier is data with a change frequency exceeding a set threshold. According to the generation times of the first stored data and the second stored data, select the data with the later generation time as the target data corresponding to the data identifier. Use the target data for service processing.
2. The method according to claim 1, characterized in that, The first stored data is in the format of key-value pairs, and the second stored data is in a compressed format.
3. The method according to claim 1 or 2, characterized in that, The change message of the data corresponding to the data identifier is generated and sent by the data storage system when the data corresponding to the data identifier changes. The processing of the data corresponding to the data identifier pulled from the data storage system in advance includes: Determine the category to which the data corresponding to the data identifier pulled from the data storage system in advance belongs according to the classification rule for data classification. Perform data compression processing on the classified data.
4. The method according to claim 3, characterized in that, The data compression processing is achieved by performing a hash operation on the data.
5. The method according to claim 3 or 4, characterized in that, The data compression processing is implemented based on a Bloom filter or a Cuckoo filter.
6. The method according to claim 1, characterized in that, The second stored data is obtained by processing the data pulled from the data storage system at regular intervals. And each time after the second stored data is obtained by processing the data pulled from the data storage system, use the processed second stored data to replace the second stored data already existing in the system memory.
7. The method according to claim 1, characterized in that, The method further includes: Regularly obtain the first stored data and the second stored data corresponding to each data identifier to be compared from the system memory. For each data identifier to be compared, determine the data to be deleted according to the generation time of the first stored data corresponding to the data identifier to be compared and the generation time of the second stored data corresponding to the data identifier to be compared. Delete the data to be deleted to clean the system memory.
8. An apparatus for business processing, characterized in that, Including: A data acquisition module for obtaining first stored data and second stored data from the system memory according to the data identifier included in the service processing request. The first stored data is obtained by processing the change message of the data corresponding to the data identifier. The second stored data is obtained by processing the data corresponding to the data identifier pulled from the data storage system in advance. Both the first stored data and the second stored data have a generation time. A version comparison module for selecting the data with the later generation time as the target data corresponding to the data identifier according to the generation times of the first stored data and the second stored data. A service processing module for using the target data for service processing.
9. An electronic device, characterized in that, Including: One or more processors; A storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method according to any one of claims 1-7.
10. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, the method according to any one of claims 1-7 is implemented.