CN112181928B - Method, device and system for executing service - Google Patents

Method, device and system for executing service Download PDF

Info

Publication number
CN112181928B
CN112181928B CN202010918082.3A CN202010918082A CN112181928B CN 112181928 B CN112181928 B CN 112181928B CN 202010918082 A CN202010918082 A CN 202010918082A CN 112181928 B CN112181928 B CN 112181928B
Authority
CN
China
Prior art keywords
service
data
user
storage unit
database
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010918082.3A
Other languages
Chinese (zh)
Other versions
CN112181928A (en
Inventor
余智铭
王志文
许谦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online Technology Co Ltd
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 Beijing Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN202010918082.3A priority Critical patent/CN112181928B/en
Publication of CN112181928A publication Critical patent/CN112181928A/en
Application granted granted Critical
Publication of CN112181928B publication Critical patent/CN112181928B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems
    • 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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The first service system receives a service request sent by a user, executes a service corresponding to the service request, and generates a data change log aiming at the service request if the service data of the user stored in a first storage space in the first service system is changed after the service corresponding to the service request is determined to be executed. And then, the data change log is sent to a second service system, so that the second service system performs data synchronization on the service data of the user stored in a second storage unit contained in the second storage space according to the data change log, and executes a second type service aiming at the user according to the service data of the user stored in the second storage unit after the data synchronization and the historical service data of the user in a second database contained in the second storage space, thereby improving the service execution efficiency.

Description

Method, device and system for executing service
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, and a system for executing a service.
Background
Currently, when a user uses a service platform, a worker also uses the service platform to provide services for the user, for example, when the user has a question about a transacted service, the worker can query the user data of the user and the service data of the transacted service of the user through the service platform, so as to solve the question of the user.
Disclosure of Invention
The specification provides a method, a device and a system for executing a service, which are used for realizing data synchronization of a first service system and a second service system.
The technical scheme adopted in the specification is as follows:
the specification provides a method for executing a service, which comprises the following steps:
a first service system receives a service request sent by a user, wherein the first service system is used for executing a first type of service aiming at the user;
if the service corresponding to the service request is determined to be executed, the service data of the user stored in a first storage space in the first service system is changed, a data change log aiming at the user is generated, the first storage space comprises a first storage unit and a first database, the first storage unit is used for storing the service data in a set time, and the first service system executes the first type of service through the first storage unit and/or the first database;
And sending the data change log to a second service system, so that the second service system synchronizes the service data stored in a second storage unit contained in a second storage space in the second service system according to the data change log, and executes a second type service for the user according to the service data stored in the second storage unit after data synchronization and the historical service data of the user stored in a second database contained in the second storage space.
Optionally, the method further comprises:
if the end of the current data synchronization period is detected, determining the data which are changed in the current data synchronization period in the first storage unit as target data;
synchronizing the target data to a first database in the first business system, such that the second business system synchronizes the target data from the first database to the second database.
The specification provides a method for executing a service, which comprises the following steps:
the second service system receives the data change log sent by the first service system;
according to the data change log, determining changed service data in a first storage space of the first service system, wherein the first storage space comprises a first storage unit and a first database as change data, and the first service system provides a first type of service to a user through the first storage unit and/or the first database;
According to the change data, synchronizing the service data stored in a second storage unit contained in a second storage space in the second service system, wherein the second storage unit is used for storing the service data in a set time;
if the second type of service needs to be executed for the user, inquiring service data of the user in the set time and historical service data of the user stored in a second database contained in the second storage space from the second storage unit according to the service type of the second type of service;
and executing the second type of service according to the service data of the user in the set time and the historical service data of the user.
Optionally, the second storage unit includes: at least one of a first response memory cell and a second response memory cell, the second response memory cell reading and writing data at a faster rate than the first response memory cell.
Optionally, according to the data change log, determining the changed service data in the first storage space of the first service system as the change data specifically includes:
extracting service data which are recorded in the data change log and are changed in the first storage unit through a data synchronization system Databus as change data;
According to the change data, synchronizing the service data stored in the second storage unit included in the second storage space in the second service system, specifically including:
and respectively synchronizing the business data stored in the first response storage unit and the second response storage unit according to the change data.
Optionally, the method further comprises:
if the end of the current data synchronization period is detected, extracting the data changed in the first database in the current data synchronization period through ETL as target data, and synchronizing the target data into the second database.
Optionally, according to the service type of the second type of service, service data of the user in the set time and historical service data of the user stored in a second database contained in the second storage space are queried from the second storage unit, and specifically include:
if the service type of the second class of service belongs to the first priority service, inquiring the service data of the user in the set time from the second response storage unit;
and if the service type of the second class of service belongs to a second priority service, inquiring the service data of the user within the set time from the first response storage unit to serve as first service data, and inquiring the historical service data of the user from the second database to serve as second service data, wherein the priority of the first priority service is higher than that of the second priority service.
Optionally, executing the second class of service according to the service data of the user in the set time and the historical service data of the user specifically includes:
and if the service type of the second type of service belongs to the second priority service, carrying out data deduplication on the first service data and the second service data to obtain deduplicated service data, and executing the second type of service according to the deduplicated service data.
The present specification provides a system for service execution, including: the system comprises a first service system and a second service system, wherein the first service system corresponds to a first storage space, the first storage space comprises a first storage unit and a first database, the second service system corresponds to a second storage space, the second storage space comprises a second storage unit and a second database, and the first storage unit and the second storage unit are used for storing service data in a set time;
the first service system receives a service request for a first type of service sent by a user, executes the first type of service corresponding to the service request through the first storage unit and/or the first database, and if the first type of service corresponding to the service request is determined to be executed, the service data of the user stored in a first storage space in the first service system is changed, a data change log for the user is generated, and the data change log is sent to a second service system;
The second service system receives the data change log sent by the first service system, determines the service data changed in the first storage space according to the data change log, synchronizes the service data stored in the second storage unit according to the change data as change data, inquires the service data of the user in the set time and the historical service data of the user stored in the second database according to the service type of the second service if the second service needs to be executed for the user, and executes the second service according to the service data of the user in the set time and the historical service data of the user stored in the second database.
The present specification provides a device for executing a service, including:
the receiving module is used for receiving a service request aiming at a first type of service sent by a user;
the determining module is used for generating a data change log aiming at the user if the service data of the user stored in a first storage space in the device is changed after the service corresponding to the service request is determined to be executed, wherein the first storage space comprises a first storage unit and a first database, and the first storage unit is used for storing the service data in a set time;
And the sending module is used for sending the data change log to a second service system so that the second service system synchronizes the service data stored in a second storage unit contained in a second storage space in the second service system according to the data change log, and executes a second type service for the user according to the service data stored in the second storage unit after data synchronization and the historical service data of the user stored in a second database contained in the second storage space.
The present specification provides a device for executing a service, including:
the receiving module is used for receiving the data change log sent by the first service system;
the determining module is used for determining the changed service data in the first storage space of the first service system as change data according to the data change log;
the synchronization module is used for synchronizing the service data stored in a second storage unit contained in a second storage space in the device according to the change data, and the second storage unit is used for storing the service data in a set time;
the query module is used for querying service data of the user in the set time and historical service data of the user stored in a second database contained in the second storage space from the second storage unit according to the service type of the second type service if the second type service needs to be executed for the user;
And the execution module is used for executing the second type of service according to the service data of the user in the set time and the historical service data of the user.
The present description provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the method of service execution described above.
The present specification provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing a method of service execution as described above when executing the program.
The above-mentioned at least one technical scheme that this specification adopted can reach following beneficial effect:
in the method for executing the service provided in the present specification, a first service system receives a service request sent by a user and executes a service corresponding to the service request, if it is determined that the service corresponding to the service request is executed, service data of the user stored in a first storage space in the first service system is changed, a data change log for the service request is generated, the first storage space includes a first storage unit and a first database, the first storage unit is used for storing service data of each user in a set time, and the first service system executes a first type of service through the first storage unit and/or the first database. And then, the data change log is sent to a second service system, so that the second service system performs data synchronization on the service data of the user stored in a second storage unit in a second storage space in the second service system according to the data change log, and executes a second type service for the user according to the service data of the user stored in the second storage unit after the data synchronization and the historical service data of the user in a second database in the second storage space.
As can be seen from the above method, the method distinguishes the first service system from the second service system both on the system level and on the data level. That is, the first service system is different from the service that the second service system is responsible for, and the data storage units corresponding to the first service system and the second service system are also distinguished. And the data synchronization of the service data of each user between the first service system and the second service system is effectively ensured while distinguishing the data storage units, so that the efficiency of executing the service by each of the first service system and the second service system is effectively improved, and the two service systems can normally execute the service respectively responsible.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification, illustrate and explain the exemplary embodiments of the present specification and their description, are not intended to limit the specification unduly. In the drawings:
fig. 1 is a schematic architecture diagram of a service platform including a first service system and a second service system provided in the present specification;
FIG. 2 is a flow chart of a method of service execution in the present specification;
FIG. 3 is a flow chart of a method of service execution in the present specification;
FIG. 4 is a schematic diagram of an apparatus for performing services provided in the present specification;
FIG. 5 is a schematic diagram of an apparatus for performing services provided in the present specification;
fig. 6 is a schematic view of an electronic device corresponding to fig. 2 or fig. 3 provided in the present specification.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the present specification more apparent, the technical solutions of the present specification will be clearly and completely described below with reference to specific embodiments of the present specification and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present specification. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
In the prior art, while the service platform provides various services for the user, other people can use the service platform to provide other services for the user, that is, the service platform needs to process the service request sent by the user and other service requests sent by other people at the same time. In addition, the service data generated by the user in the service platform and the service data used by other personnel in the service platform are stored in the same database, so that the service platform needs to access the database when processing the service request sent by the user or other service requests sent by other personnel, and therefore the database can face a larger access pressure.
For example, when the service platform is processing service requests of many users, other people inquire about users who need to pay back the credit card after two days through the service platform and send short messages to the users to notify the users of payment, the service platform needs to process service requests of all users and inquiry requests of other people at the same time, and then needs to frequently access a database storing service data of the users during the period. It can be seen that a large number of service requests and other service requests may cause excessive load on the service platform and the database, so that the services executed by the user and other personnel on the service platform may be affected, and further, the service execution efficiency of the service platform is reduced.
In order to solve the above-mentioned problems, the present specification provides a method of executing a service, in which a service platform can be split into a first service system and a second service system, the first service system making the second service system be data-synchronized with the first service system by transmitting a data change log to the second service system, although the second service system is separated from the first service system on a data level and a service level. Therefore, the first service system and the second service system can normally execute the service, and the efficiency of executing the service is improved by the first service system and the second service system.
The following describes in detail the technical solutions provided by the embodiments of the present specification with reference to the accompanying drawings.
In this specification, the first service system and the second service system are commonly assigned to the same service platform, and the first service system and the second service system are also respectively responsible for executing different services, as shown in fig. 1.
Fig. 1 is a schematic architecture diagram of a service platform including a first service system and a second service system provided in the present specification.
In fig. 1, the service platform includes a first service system and a second service system, where the first service system is used for executing a first type of service of a user, and the second service system is used for executing a second type of service of the user. The first service system corresponds to a first storage space, the first storage space comprises a first storage unit and a first database, the second service system corresponds to a second storage space, the second storage space comprises a second storage unit and a second database, and the second storage unit comprises a first response storage unit and a second response storage unit. The first storage unit stores service data of each user generated in real time within a set time, and the first database stores historical service data of each user, and the first database does not contain the service data generated in real time. The data stored in the second database is data synchronized by the first database, that is, the data stored in the first database and the data stored in the second database should be identical after the data synchronization. The second storage unit synchronizes the data stored in the first storage unit in real time, namely, the first response storage unit and the second response storage unit synchronize the data in the first storage unit in real time. The data reading and writing rate of the second response storage unit is faster than that of the second response storage unit, and correspondingly, the first response storage unit and the second response storage unit can cope with different types of second type services which can be provided by the second service system. The method of service execution provided in the present specification will be described in detail.
Fig. 2 is a flow chart of a method for executing a service in the present specification, specifically including the following steps:
s201: and the first service system receives a service request sent by a user and is used for executing a first type of service aiming at the user.
In practical applications, the user may use a terminal held by the user or a client installed in the terminal to execute each service provided in the first service system, where the terminal refers to a device such as a mobile phone, a notebook computer, or a desktop computer held by the user, and the client refers to the device provided by the first service system.
If the user needs to execute the first type of service in the first service system, the service request corresponding to the service can be sent to the first service system through the client, and the first service system can execute the service required to be executed by the user after receiving the service request. For example, a user purchases a financial product in a service platform and pays for the balance in an account of the service platform, then the first service system receives a service request for the user to transact the financial product, and the first service system may process the service request to complete the purchase of the financial product.
The first type of service mentioned here may refer to a service actively initiated by a user, such as online shopping, financial, ordering takeaway, etc., and the second type of service executed by the second service system mentioned later may refer to a service provided by other personnel to the user, such as a commodity/service recommendation to the user, a marketing service of sending marketing information to the user, a customer service of providing customer service to the user (customer service is usually actively applied by the user, but data request to a service platform is initiated by customer service personnel in a specific execution process), etc. Therefore, in this specification, the first service system is mainly responsible for interfacing with the user itself, and the second service system is mainly responsible for other people or third party service parties who provide services to the user.
S203: and if the service corresponding to the service request is determined to be executed, the service data of the user stored in the first storage space in the first service system is changed, and a data change log aiming at the user is generated.
After the first service system executes the service corresponding to the service request, if the service data of the user stored in the first storage space is changed, a data change log for the user is generated, and the data change log records the changed data in the first storage space in real time. For example, after the user purchases the financial product, the first storage space is added with the order data of the financial product, and the account balance of the user on the service platform is changed, so that the data change log records the order data and the change condition of the account balance of the user on the service platform in real time.
Each user performs a service in a first service system, which can store service data generated in real time through a first storage unit, while leaving service data. Since the storage space of the first storage unit is limited, the first storage unit stores only the service data of each user within a set time, for example, the first storage unit stores only the service data generated in the first service system within 3 months (including the current day), and the set time may be set according to the actual requirement. Correspondingly, the above-mentioned first service system sends the service data change after executing the service corresponding to the service request, and the service data of the user stored in the first storage unit should be used.
Since the first storage unit stores only the service data within the set time, and the service data before the set time is also required to be stored, the first service system can store the historical service data of each user through the first database. The historical service data stored in the first database is obtained through the first storage unit, but the service data in the first storage unit is synchronized periodically by the first database, so that the service data stored in the first database at least comprises the service data of each user before the setting time before the data synchronization is not performed. Therefore, the data synchronization referred to herein refers to synchronizing the service data held by the first storage unit into the first database such that the service data held by the first storage unit is stored in the first database.
Specifically, the first service system may perform data synchronization on the first database and the first storage unit periodically according to a pre-divided data synchronization period, and if the first service system monitors that the current data synchronization period is over, the first service system may use the data in the first storage unit, which is changed in the current data synchronization period, as target data, and synchronize the target data to the first database. The data synchronization period may be divided according to actual requirements, for example, one data synchronization period per day, or one data synchronization period per week, etc. In addition, the time length of the data synchronization period should not exceed the time length of the above-mentioned set time.
For example, the first service system may set the time length of the data synchronization period to 1 day, and then the current data synchronization period is today, and the first service system monitors that the current data synchronization period is 24 points today, that is, when the current data synchronization period ends, the first service system may synchronize the data changed in the first storage unit today into the first database.
Wherein, the first storage unit and the data stored in the first database have a certain intersection. For example, when the data synchronization period is every day, before data synchronization is performed every day, the first database stores all the service data of each user except the day, and if the set time period is 3 months, the first storage unit stores the service data of each user within 3 months and contains the service data of each user of the day. It can be seen that in this example, the data where there is an intersection between the first storage unit and the data stored in the first database is traffic data of each user except for the current day within 3 months.
In addition, the first storage unit may be a storage space in the form of MySQL, SQL Server, or the like, which is not illustrated in detail herein, and the first database may be a storage space in the form of Hive, or the like.
S204: and sending the data change log to a second service system, so that the second service system synchronizes the service data stored in a second storage unit contained in a second storage space in the second service system according to the data change log, and executes a second type service for the user according to the service data stored in the second storage unit after data synchronization and the historical service data of the user of a second database contained in the second storage space.
After the first service system executes the service corresponding to the service request and generates a corresponding data change log, the data change log can be sent to the second service system, after the second service system receives the data change log, data synchronization can be performed according to the data change log, the second service system can determine the service data of the user, which is recorded in the data change log and is changed in the first storage unit, and then the service data of the user is synchronized in the second storage unit. After the data synchronization, the second storage unit is consistent with the data stored in the first storage unit, so that the service data of each user in the set time is stored in the second storage unit. Correspondingly, the second service system corresponds to a second database, and the data in the second database is synchronized with the first database, that is, if the first database synchronizes the target data in the current data synchronization period, the second database should synchronize the target data in the current data synchronization period.
The method for executing a service provided in the present specification is described above, and since the method for executing a service provided in the present specification involves interaction between the first service system and the second service system in the data synchronization process, the method for executing a service provided in the present specification is described below with the second service system as an executing body.
Fig. 3 is a flow chart of a method for executing a service in the present specification, specifically including the following steps:
s301: the second service system receives the data change log sent by the first service system.
S302: and determining the business data changed in the first storage space of the first business system as change data according to the data change log.
After the second service system receives the data change log sent by the first service system, the service data of the user, which is changed in the first storage unit corresponding to the first service system, can be determined through the data change log and used as change data, so that the data synchronization is performed on the second storage unit.
The second service system may extract the change data recorded in the data change log through the data synchronization system Databus as shown in fig. 3, and perform data synchronization through the change data. In addition to Databus, the specific manner in which the second service system extracts the change data may also be varied, for example, maxwell, etc., which will not be described in detail herein.
S303: and synchronizing the service data stored in a second storage unit included in a second storage space in the second service system according to the change data, wherein the second storage unit is used for storing the service data in a set time.
After the second service system determines the change data, the second service system can synchronize the service data of the user stored in the second storage unit through the change data, so that as long as the service data in the first storage unit changes, the second service system can acquire the changed service data in real time, and the service data is synchronized into the second storage unit belonging to the second service system.
In practical applications, the second service system is required to quickly query a large amount of data from the second storage unit in some special service scenarios. For example, a short message for reminding the users to pay back is sent to the users who need to pay back after 2 days through the second service system currently, and then the second service system needs to inquire all user data such as user names, telephone numbers and the like of the users who need to pay back after 2 days at this time, so that the short message for reminding the users to pay back is sent to the users.
For another example, if the new product offer information needs to be sent to all users currently, the user account numbers of the users can be queried through the second service system, and the offer information is pushed to the users based on the user account numbers of the users.
Based on the above situations, the second storage unit may include the first response storage unit and the second response storage unit, where the second response storage unit reads and writes data at a faster rate, and may be suitable for the above service scenario that needs to quickly query a large amount of data. Because the second storage unit includes the first response storage unit and the second response storage unit, the second service system also needs to synchronize the change data to the first response storage unit and the second response storage unit when the data synchronization is performed. The first response storage unit may be a storage space in the form of MySQL, SQL Server, etc., which is not illustrated in detail herein, and the second response storage unit may be a storage space in the form of Tair, etc.
It should be noted that, the second storage unit only stores the service data of each user in the set time, so the second service system also corresponds to a second database, and the second database includes the service data before the set time of each user. The historical business data of each user stored in the second database is periodically synchronized from the first database. Specifically, when the second service system monitors that the current data synchronization period is finished, the second service system may acquire, through the ETL, data that is changed in the first database in the current data synchronization period as target data in a manner shown in fig. 3, and synchronize the target data to the second database. The second database may be a storage space in the form of an Elastic Search, an Apache Solr, or the like, which is not particularly limited herein. In addition, a customized data table (for example, hive table) can be determined in advance according to actual requirements, and the data table is synchronized from the first database to the second database during data synchronization.
For example, if the data synchronization period is 1 day, the 24-point first service system synchronizes the data changed in the first storage unit in the past day as the target data into the first database, and the second service system may synchronize the target data into the second database at this time.
S304: and if the second type of service needs to be executed for the user, inquiring service data of the user in the set time and historical service data of the user stored in a second database contained in the second storage space from the second storage unit according to the service type of the second type of service.
S305: and executing the second type of service according to the service data of the user in the set time and the historical service data of the user.
The user may execute the services provided by the first service system via the client, and the second service system may provide a second class of services for the user after executing these services. For example, if a user can make a query about a service handled by the user in the first service system, a customer service staff can query the service data of the service handled by the user through the second service system and answer the query of the user (the service provided to the user is the second type of service).
It should be noted that, the second service system may provide multiple second-class services for the user, where different second-class services correspond to different priorities, and each priority may be set according to a service type and an actual requirement of each second-class service.
Based on this, the second service system can execute the second class service for the user who has changed the service data after performing the data synchronization according to the change data. The second service system can determine the service type of the second type of service, if the service type of the second type of service belongs to the first priority service, the service data of the user in the set time can be queried from the second response storage unit with higher reading and writing speed, and the second type of service of the user is executed.
If the service type of the second class service belongs to the second priority service, the service data of the user in the set time can be queried from the first response storage unit to be used as the first service data, the historical service data of the user is queried from the second database to be used as the second service data, and the first service data and the second service data are de-duplicated to obtain de-duplicated service data, so that the second class service for the user is executed according to the de-duplicated service data. As can be seen from the above, the priority of the first priority service is higher than that of the second priority service, and the required data response speed is also faster, so that the service data of each user stored in the second response storage unit with a faster read/write rate can be used for the first priority service.
For example, when the second type of service for the user needs to be executed, the second service system may query the service data of the user from 10 months to 12 months in the present year through the first response storage unit, and then query the service data of the user from 1 month to 11 months in the present year through the second database, where the user starts to execute the service in the service platform in the present year, and thus the queried historical service data starts from 1 month. It can be seen that the service data queried from the first response storage unit and the service data queried from the second database are repeated in the part of the service data from 10 months to 11 months, so that the second service system can de-duplicate the queried service data, and further execute the additional service for the user according to the de-duplicated service data.
It should be noted that, when the service type of the second class service belongs to the second priority service, if the service data of the user only needs to be set before the second class service of the user is executed, the second service system may directly query the historical service data of the user from the second database. For the first priority service and the second priority service, the second service system may include service interfaces corresponding to different second type services, so that for service requests of different second type services, the service requests may be received through corresponding service interfaces, and the second type service for the user is executed.
It can be seen from the above method that, compared with the prior art, the services provided by the service platform are not changed, but are divided on the system level, i.e. the first service system is responsible for handling the first type of service for the user, the second service system is responsible for handling the second type of service for the user, and the storage space on which the two service systems respectively read and write data is based is also separated on the hardware level. Meanwhile, in order to ensure the accuracy of the first service system when executing the first type of service of the user and the accuracy of the second service system when executing the second type of service aiming at the user, the first service system and the second service system perform data synchronization on a data layer, so that normal service execution of the first service system and the second service system can be ensured, and meanwhile, the service execution efficiency of the first service system and the second service system is effectively improved.
In the following, a specific example is used to describe a complete execution process, for example, the user a may execute a first type of service provided by the first service system through the client, where the first service system may store service data generated by the user a executing the service in the first storage unit (e.g. MySQL), and when this is used, a customer service person may query, according to a customer service requirement of the user B, the service data of the user B through the second service system, so as to solve the query of the user B. The second business system may query the business data corresponding to the user B from the first response storage unit (e.g., mySQL) and the second database (e.g., elastic Search). On the other hand, the marketer can formulate a strategy of pushing service products to each user and implement the strategy through the second service system, for example, when the marketer performs preferential activities of the products, the second service system can query the telephone numbers of each user through the second response storage unit (for example, tair) and push preferential activity information to each user through a short message sending mode.
As can be seen from the above, the service systems used by the user and other people (such as customer service personnel and marketers) are different, and in the physical layer, the storage space required to be accessed by the user to execute the service is also differentiated from the storage space required to be accessed by other people to execute the second type of service, so that the first type of service executed by the user is not affected by the second type of service executed by other people, thereby improving the efficiency of executing the service.
The above method for executing the service provided by one or more embodiments of the present disclosure further provides a corresponding device for executing the service based on the same concept, as shown in fig. 4 and fig. 5.
Fig. 4 is a schematic diagram of a service execution device provided in the present specification, which specifically includes:
a receiving module 401, configured to receive a service request for a first type of service sent by a user;
a determining module 402, configured to generate a data change log for the user if it is determined that the service data of the user stored in a first storage space in the device is changed after the service corresponding to the service request is executed, where the first storage space includes a first storage unit and a first database, and the first storage unit is configured to store the service data in a set time;
And a sending module 403, configured to send the data change log to a second service system, so that the second service system synchronizes, according to the data change log, service data stored in a second storage unit included in a second storage space in the second service system, and executes a second type service for the user according to the service data stored in the second storage unit after data synchronization and historical service data of the user stored in a second database included in the second storage space.
Optionally, the apparatus further comprises:
a synchronization module 404, configured to determine, as target data, data in the first storage unit that has been changed in the current data synchronization period if it is detected that the current data synchronization period is over; synchronizing the target data to a first database in the first business system, such that the second business system synchronizes the target data from the first database to the second database.
Fig. 5 is a schematic diagram of a service execution device provided in the present specification, which specifically includes:
a receiving module 501, configured to receive a data change log sent by a first service system;
A determining module 502, configured to determine, according to the data change log, service data that is changed in the first storage space of the first service system as change data;
a synchronization module 503, configured to synchronize, according to the change data, service data stored in a second storage unit included in a second storage space in the device, where the second storage unit is used to store service data in a set time;
a query module 504, configured to query, if it is determined that a second type of service needs to be executed for a user, service data of the user in the set time and historical service data of the user stored in a second database included in the second storage space from the second storage unit according to a service type of the second type of service;
and the executing module 505 is configured to execute the second type of service according to the service data of the user in the set time and the historical service data of the user.
Optionally, the second storage unit includes: at least one of a first response memory cell and a second response memory cell, the second response memory cell reading and writing data at a faster rate than the first response memory cell.
Optionally, the determining module 502 is specifically configured to extract, through a data synchronization system Databus, service data that is recorded in the data change log and has changed in the first storage unit, as change data;
the synchronization module 503 is specifically configured to synchronize the service data stored in the first response storage unit and the second response storage unit according to the change data.
Optionally, the synchronization module 503 is further configured to, if it is detected that the current data synchronization period is over, extract, by the ETL, data changed in the first database in the current data synchronization period as target data, and synchronize the target data to the second database.
Optionally, the query module 504 is specifically configured to query, from the second response storage unit, service data of the user within the set time if the service type of the second class of service belongs to a first priority service; and if the service type of the second class of service belongs to a second priority service, inquiring the service data of the user within the set time from the first response storage unit to serve as first service data, and inquiring the historical service data of the user from the second database to serve as second service data, wherein the priority of the first priority service is higher than that of the second priority service.
Optionally, the executing module 505 is specifically configured to, if the service type of the second type of service belongs to a second priority service, perform data deduplication on the first service data and the second service data to obtain deduplicated service data, and execute the second type of service according to the deduplicated service data.
The present specification also provides a computer-readable storage medium storing a computer program operable to perform the method of service execution provided in fig. 2 or 3 described above.
The present specification also provides a schematic structural diagram of the electronic device shown in fig. 6. At the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile storage, as illustrated in fig. 6, although other hardware required by other services may be included. The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs to implement the method for executing the service described in fig. 2 or fig. 3. Of course, other implementations, such as logic devices or combinations of hardware and software, are not excluded from the present description, that is, the execution subject of the following processing flows is not limited to each logic unit, but may be hardware or logic devices.
In the 90 s of the 20 th century, improvements to one technology could clearly be distinguished as improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software (improvements to the process flow). However, with the development of technology, many improvements of the current method flows can be regarded as direct improvements of hardware circuit structures. Designers almost always obtain corresponding hardware circuit structures by programming improved method flows into hardware circuits. Therefore, an improvement of a method flow cannot be said to be realized by a hardware entity module. For example, a programmable logic device (Programmable Logic Device, PLD) (e.g., field programmable gate array (Field Programmable Gate Array, FPGA)) is an integrated circuit whose logic function is determined by the programming of the device by a user. A designer programs to "integrate" a digital system onto a PLD without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, such programming is mostly implemented by using "logic compiler" software, which is similar to the software compiler used in program development and writing, and the original code before the compiling is also written in a specific programming language, which is called hardware description language (Hardware Description Language, HDL), but not just one of the hdds, but a plurality of kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), lava, lola, myHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog are currently most commonly used. It will also be apparent to those skilled in the art that a hardware circuit implementing the logic method flow can be readily obtained by merely slightly programming the method flow into an integrated circuit using several of the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable logic controllers, and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller may thus be regarded as a kind of hardware component, and means for performing various functions included therein may also be regarded as structures within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present specification.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the present specification may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing is merely exemplary of the present disclosure and is not intended to limit the disclosure. Various modifications and alterations to this specification will become apparent to those skilled in the art. Any modifications, equivalent substitutions, improvements, or the like, which are within the spirit and principles of the present description, are intended to be included within the scope of the claims of the present description.

Claims (13)

1. A method for service execution, comprising:
a first service system receives a service request sent by a user, wherein the first service system is used for executing a first type of service aiming at the user;
if the service corresponding to the service request is determined to be executed, the service data of the user stored in a first storage space in the first service system is changed, a data change log aiming at the user is generated, the first storage space comprises a first storage unit and a first database, the first storage unit is used for storing the service data in a set time, and the first service system executes the first type of service through the first storage unit and/or the first database;
And sending the data change log to a second service system, so that the second service system synchronizes the service data stored in a second storage unit contained in a second storage space in the second service system according to the data change log, and executes a second type service for the user according to the service data stored in the second storage unit after data synchronization and the historical service data of the user stored in a second database contained in the second storage space.
2. The method of claim 1, wherein the method further comprises:
if the end of the current data synchronization period is detected, determining the data which are changed in the current data synchronization period in the first storage unit as target data;
synchronizing the target data to a first database in the first business system, such that the second business system synchronizes the target data from the first database to the second database.
3. A method for service execution, comprising:
the second service system receives the data change log sent by the first service system;
according to the data change log, determining changed service data in a first storage space of the first service system, wherein the first storage space comprises a first storage unit and a first database as change data, and the first service system provides a first type of service to a user through the first storage unit and/or the first database;
According to the change data, synchronizing the service data stored in a second storage unit contained in a second storage space in the second service system, wherein the second storage unit is used for storing the service data in a set time;
if the second type of service needs to be executed for the user, inquiring service data of the user in the set time and historical service data of the user stored in a second database contained in the second storage space from the second storage unit according to the service type of the second type of service;
and executing the second type of service according to the service data of the user in the set time and the historical service data of the user.
4. The method of claim 3, wherein the second storage unit comprises: the data reading and writing device comprises a first response storage unit and a second response storage unit, wherein the data reading and writing speed of the second response storage unit is faster than that of the first response storage unit.
5. The method of claim 4, wherein determining, as change data, the changed service data in the first storage space of the first service system according to the data change log, specifically includes:
Extracting service data which are recorded in the data change log and are changed in the first storage unit through a data synchronization system Databus as change data;
according to the change data, synchronizing the service data stored in the second storage unit included in the second storage space in the second service system, specifically including:
and respectively synchronizing the business data stored in the first response storage unit and the second response storage unit according to the change data.
6. A method as claimed in claim 3, wherein the method further comprises:
if the end of the current data synchronization period is detected, extracting the data changed in the first database in the current data synchronization period through ETL as target data, and synchronizing the target data into the second database.
7. The method of claim 4, wherein the querying, from the second storage unit, the service data of the user in the set time and the historical service data of the user stored in the second database included in the second storage space according to the service type of the second type of service specifically includes:
If the service type of the second class of service belongs to the first priority service, inquiring the service data of the user in the set time from the second response storage unit;
and if the service type of the second class of service belongs to a second priority service, inquiring the service data of the user within the set time from the first response storage unit to serve as first service data, and inquiring the historical service data of the user from the second database to serve as second service data, wherein the priority of the first priority service is higher than that of the second priority service.
8. The method of claim 7, wherein the second class of services is executed based on the service data of the user within the set time and the historical service data of the user, specifically comprising:
and if the service type of the second type of service belongs to the second priority service, carrying out data deduplication on the first service data and the second service data to obtain deduplicated service data, and executing the second type of service according to the deduplicated service data.
9. A system for service execution, comprising: the system comprises a first service system and a second service system, wherein the first service system corresponds to a first storage space, the first storage space comprises a first storage unit and a first database, the second service system corresponds to a second storage space, the second storage space comprises a second storage unit and a second database, and the first storage unit and the second storage unit are used for storing service data in a set time;
The first service system receives a service request for a first type of service sent by a user, executes the first type of service corresponding to the service request through the first storage unit and/or the first database, and if the first type of service corresponding to the service request is determined to be executed, the service data of the user stored in a first storage space in the first service system is changed, a data change log for the user is generated, and the data change log is sent to a second service system;
the second service system receives the data change log sent by the first service system, determines the service data changed in the first storage space according to the data change log, synchronizes the service data stored in the second storage unit according to the change data as change data, inquires the service data of the user in the set time and the historical service data of the user stored in the second database according to the service type of the second service if the second service needs to be executed for the user, and executes the second service according to the service data of the user in the set time and the historical service data of the user stored in the second database.
10. An apparatus for performing a service, comprising:
the receiving module is used for receiving a service request aiming at a first type of service sent by a user;
the determining module is used for generating a data change log aiming at the user if the service data of the user stored in a first storage space in the device is changed after the service corresponding to the service request is determined to be executed, wherein the first storage space comprises a first storage unit and a first database, and the first storage unit is used for storing the service data in a set time;
and the sending module is used for sending the data change log to a second service system so that the second service system synchronizes the service data stored in a second storage unit contained in a second storage space in the second service system according to the data change log, and executes a second type service for the user according to the service data stored in the second storage unit after data synchronization and the historical service data of the user stored in a second database contained in the second storage space.
11. An apparatus for performing a service, comprising:
the receiving module is used for receiving the data change log sent by the first service system;
The determining module is used for determining the changed service data in the first storage space of the first service system as change data according to the data change log;
the synchronization module is used for synchronizing the service data stored in a second storage unit contained in a second storage space in the device according to the change data, and the second storage unit is used for storing the service data in a set time;
the query module is used for querying service data of the user in the set time and historical service data of the user stored in a second database contained in the second storage space from the second storage unit according to the service type of the second type service if the second type service needs to be executed for the user;
and the execution module is used for executing the second type of service according to the service data of the user in the set time and the historical service data of the user.
12. A computer readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method of any of the preceding claims 1-2 or 3-8.
13. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of the preceding claims 1-2 or 3-8 when executing the program.
CN202010918082.3A 2020-09-03 2020-09-03 Method, device and system for executing service Active CN112181928B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010918082.3A CN112181928B (en) 2020-09-03 2020-09-03 Method, device and system for executing service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010918082.3A CN112181928B (en) 2020-09-03 2020-09-03 Method, device and system for executing service

Publications (2)

Publication Number Publication Date
CN112181928A CN112181928A (en) 2021-01-05
CN112181928B true CN112181928B (en) 2024-02-23

Family

ID=73924741

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010918082.3A Active CN112181928B (en) 2020-09-03 2020-09-03 Method, device and system for executing service

Country Status (1)

Country Link
CN (1) CN112181928B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104615759A (en) * 2015-02-13 2015-05-13 厦门雅迅网络股份有限公司 Data synchronization method for different business system platforms
CN107070858A (en) * 2016-12-21 2017-08-18 阿里巴巴集团控股有限公司 A kind of method for processing business and device
CN109450976A (en) * 2018-10-09 2019-03-08 网宿科技股份有限公司 A kind of method and device of the access of operation system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070198992A1 (en) * 2006-01-26 2007-08-23 International Business Machines Corporation Changing submitted asynchronous business events to synchronous business events in a Business processing system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104615759A (en) * 2015-02-13 2015-05-13 厦门雅迅网络股份有限公司 Data synchronization method for different business system platforms
CN107070858A (en) * 2016-12-21 2017-08-18 阿里巴巴集团控股有限公司 A kind of method for processing business and device
CN109450976A (en) * 2018-10-09 2019-03-08 网宿科技股份有限公司 A kind of method and device of the access of operation system

Also Published As

Publication number Publication date
CN112181928A (en) 2021-01-05

Similar Documents

Publication Publication Date Title
TWI752118B (en) A blockchain consensus method and device
US11036689B2 (en) Blockchain-based data processing method and device
CN106899666B (en) Data processing method and device for service identification
CN108345977B (en) Service processing method and device
CN109670784B (en) Method, device and system for informing waiting time
WO2019196551A1 (en) Payment process configuration and execution method, apparatus and device
CN110008018A (en) A kind of batch tasks processing method, device and equipment
CN110389989B (en) Data processing method, device and equipment
CN110297837B (en) Data updating method and device and data query method and device
TWI742332B (en) Information push method, device and equipment
CN111179090B (en) Transaction data processing method, device and equipment
CN109902077B (en) Service request processing method, device and equipment
CN110263050B (en) Data processing method, device, equipment and storage medium
CN110032582B (en) Data processing method, device, equipment and system
CN108830705B (en) Method, device and equipment for summarizing transaction data
CN108648006B (en) Shop recommendation method and device
CN111629062A (en) Message pushing method and device
CN112181928B (en) Method, device and system for executing service
CN108959330A (en) A kind of processing of database, data query method and apparatus
CN114201086B (en) Information display method and device
CN111967769B (en) Risk identification method, apparatus, device and medium
CN110008358B (en) Resource information display method and system, client and server
CN110187987B (en) Method and apparatus for processing requests
CN110245115B (en) File processing method, engine and system
CN111967767A (en) Business risk identification method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant