State synchronization method and device, equipment and storage medium

By generating and parsing binary log files, synchronizing the underlying database status of the load balancing service to the console, the problem of inconsistency between the console and the underlying status in the cloud computing environment is solved, and high performance and high availability application guarantees are achieved.

CN119884131APending Publication Date: 2025-04-25华润数字科技有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411907377.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

In a cloud computing environment, the underlying state of the load balancing service changes frequently, resulting in the state displayed on the console being inconsistent with the actual underlying state, affecting the high performance and high availability of the application.

Method used

By listening to the data change operations in the database, a binary log file is generated and parsed to determine whether the event content is related to the console of the load balancing service. If it is related, a state update request is generated and the data objects and attributes in the console are synchronized.

Benefits of technology

It realizes the consistency of state between the underlying database and the upper console, ensures the accuracy of the status displayed by the console, and supports the accurate execution of the automated operation and maintenance system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119884131A_ABST
    Figure CN119884131A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a state synchronization method and device, equipment and a storage medium, and the method comprises the steps: monitoring a data change operation of a database, and generating a binary log file; the binary log file is analyzed, and analyzed event content is obtained; whether the event content is related to a console of a load balancing service or not is judged, if yes, a state updating request is generated, and the state updating request comprises a to-be-updated data object and an updating attribute; and according to the state updating request, synchronizing the data object and the updating attribute in the console. According to the embodiment of the invention, when the data state in the underlying database is changed, the binary log file record is triggered immediately, and a console can quickly obtain the change and update the state through an efficient binary log file analysis and event processing mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a state synchronization method, device, equipment and storage medium. Background Art

[0002] In the era of cloud computing, Server Load Balancer (SLB) is an important part of Infrastructure as a Service (IaaS), and the technical architecture behind it is becoming increasingly complex. A typical SLB product may rely on a large-scale data center, involving numerous servers, network devices, storage systems, and complex software layers. These components work together to achieve load balancing functions, and the underlying status changes frequently, including the addition or exit of servers, fluctuations in network bandwidth, and adjustments to the allocation of storage resources.

[0003] SLB products are usually built based on a distributed system architecture. The characteristic of a distributed system is that there is no global, unified control center, and each node runs relatively independently, but needs to work together. This requires an effective mechanism to ensure that the status of each node can be accurately presented on the console.

[0004] With the rapid development of Internet applications, users have higher and higher requirements for service quality and experience. For application developers and operation and maintenance teams using SLB services, it is necessary to accurately understand the underlying status through the console so as to adjust service strategies in time and ensure high performance and high availability of applications.

[0005] Automated operation and maintenance systems rely on accurate status information to perform various operations, such as automatic expansion and contraction, automatic fault recovery, etc. If the console status is inconsistent with the underlying status, these automated operations may fail. Summary of the invention

[0006] The embodiment of the present invention provides a state synchronization method, apparatus, device and storage medium, which aims to provide a state synchronization method so that the data state in the bottom database is guaranteed to be consistent with the data state in the upper control console.

[0007] In a first aspect, an embodiment of the present invention provides a state synchronization method, the method comprising:

[0008] Monitor data change operations in the database and generate binary log files;

[0009] Parsing the binary log file to obtain parsed event content;

[0010] Determine whether the event content is related to the console of the load balancing service, and if so, generate a status update request, wherein the status update request includes a data object to be updated and an update attribute;

[0011] The data object and the updated attribute in the console are synchronized according to the status update request.

[0012] Furthermore, the step of determining whether the event content is related to the console of the load balancing service includes:

[0013] Determining whether the event content involves the backend server status of the console;

[0014] If the event content is related to the backend server status of the console, determining that the event content is related to the console of the load balancing service;

[0015] Otherwise, it is determined that the event content is irrelevant to the console of the load balancing service.

[0016] Furthermore, the step of parsing the binary log file to obtain the parsed event content includes:

[0017] According to the format of the binary log file, the binary log file is parsed using a method corresponding to the format.

[0018] Furthermore, according to the format of the binary log file, the binary log file is parsed using a method corresponding to the format, the steps comprising:

[0019] If the format of the binary log file is STATEMENT, the event content is obtained by parsing the database statement;

[0020] If the format of the binary log file is ROW, the event content is obtained by parsing the row data.

[0021] Furthermore, the step of monitoring the data change operation occurring in the database and generating a binary log file comprises:

[0022] Receiving and parsing the binary log file through a data synchronization component;

[0023] Sending the binary log file to a message queue of a message queue component;

[0024] Create a consumer of the message queue component to capture the binary log file.

[0025] Furthermore, before the step of monitoring the data change operation occurring in the database, the step further includes:

[0026] The database is controlled to enable a binary log function, and configuration parameters of the binary log file are set in a configuration file of the database.

[0027] Furthermore, the step of monitoring the data change operation occurring in the database and generating a binary log file comprises:

[0028] If any one of the operations of inserting, updating and deleting occurs in the database, the binary log file is generated, and the binary log file is used to record all modifications to the database.

[0029] In a second aspect, an embodiment of the present invention provides a state synchronization device, the state synchronization device comprising:

[0030] The change module is used to monitor data change operations in the database and generate binary log files;

[0031] A parsing module, used to parse the binary log file to obtain parsed event content;

[0032] A request module, used to determine whether the event content is related to the console of the load balancing service, and if so, generate a status update request, wherein the status update request includes a data object to be updated and an update attribute;

[0033] An updating module is used to synchronize the data object and the updated attribute in the console according to the status update request.

[0034] In a third aspect, an embodiment of the present invention provides a computer device, the device comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0035] Memory, used to store computer programs;

[0036] The processor is used to implement the steps of a state synchronization method provided in the first aspect when executing a program stored in the memory.

[0037] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of a state synchronization method provided in the first aspect.

[0038] The embodiment of the present invention provides a state synchronization method, device, equipment and storage medium. When state synchronization is performed, if a change operation occurs in the database, a binary log file will be generated; the binary log file will be parsed to obtain the parsed event content; if it is determined whether the event content is related to the console, a state update data request will be generated if it is related; and the data objects and attributes in the console will be synchronized according to the state update data request. The embodiment of the present invention records all modification operations in the database through a binary log file, so that every detail of the underlying state change can be fully captured, thereby ensuring the accuracy of the console state, and synchronizing the changed data to the back-end server of the console, ensuring the state consistency between the underlying database and the upper-level console.

[0039] In the embodiment of the present invention, when the data status in the underlying database changes, a binary log file record will be triggered immediately. Through the efficient binary log file parsing and event processing mechanism, the console can quickly obtain these changes and update the status; and after the binary log function of the database is enabled through simple configuration, the commands and library functions provided by it can be used to parse the binary log, and the status synchronization logic can be integrated into the back-end service of the console, which has the advantages of high efficiency and convenience. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0041] Figure 1 A flow chart of a state synchronization method provided by an embodiment of the present invention;

[0042] Figure 2 A timing diagram of a state synchronization method provided by an embodiment of the present invention;

[0043] Figure 3 A schematic diagram of the structure of a state synchronization device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0045] In order to make the description of the disclosed content more detailed and complete, the following is an illustrative description of the implementation mode and specific examples of the present invention; however, this is not the only form of implementing or applying the specific embodiments of the present invention. The implementation mode covers the features of multiple specific embodiments and the method steps and their sequence for constructing and operating these specific embodiments. However, other specific embodiments can also be used to achieve the same or equal functions and step sequences. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0046] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein.

[0047] In the description of the embodiments of the present invention, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two, and other quantifiers are similar. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention, and the embodiments of the present application and the features in the embodiments may be combined with each other without conflict.

[0048] A state synchronization method provided by an embodiment of the present invention can be applied to application scenarios such as e-commerce platforms, cloud computing, the Internet of Things, and big data processing. Taking the application in cloud computing as an example, the console of the server monitors the database in the client, monitors the data change operation in the database, and generates a binary log file; then the binary log file is parsed to obtain the parsed event content; then it is determined whether the event content is related to the console of the load balancing service. If the event content is related to the console of the load balancing service, a state update request is generated, and the state update request includes the data object to be updated and the update attribute; finally, according to the state update request, the data object and the update attribute in the console are synchronized, thereby achieving the consistency of the data state of the console in the server and the database in the client.

[0049] The server can be implemented by an independent server or a server cluster composed of multiple servers. The client can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto. The client and the server can be connected via Bluetooth, USB (Universal Serial Bus) or other communication connection methods, which is not limited in the embodiments of the present invention.

[0050] Figure 1 A flow chart of a state synchronization method provided by an embodiment of the present invention, such as Figure 1 As shown, the method includes:

[0051] S110, monitoring data change operations occurring in the database and generating a binary log file;

[0052] In the embodiment of the present invention, the database is used to store the configuration data and status data of the load balancing service, the configuration data includes the listening port, virtual IP and server list, etc.; the status data includes the connection status, the backend server status, etc., which can be determined according to the actual situation, and the embodiment of the present invention does not make specific restrictions on this. The database can be MySQL.

[0053] Any data change operation in the database will be recorded in the binary log file, which is the Binlog file. Among them, the Binlog file is the binary log of the database, which records all the change operations in the database. These operations are recorded in the form of events. The format of the binary log is more compact, occupies relatively less space, and has higher recording efficiency. The Binlog file mainly contains two types of information: one is the time when the event occurred, and the other is the content of the event itself. The event content includes details such as the operation type, the table involved in the operation, and the specific row data changes. The operation type includes insert, update, and delete.

[0054] In the embodiment of the present invention, all modification operations in the database are recorded through the Binlog file, including insert, update and delete operations on the SLB configuration table and the status record related table, so that every detail of the underlying status change can be fully captured, thereby ensuring the accuracy of the console status.

[0055] S120, parsing the binary log file to obtain parsed event content;

[0056] The embodiment of the present invention parses the binary file. Parsing the binary log file refers to the process of converting log data stored in binary format into an understandable information format. Parsing is to restore these binary encoded data into easily understandable content such as SQL statement data change details.

[0057] The event content includes the data that has been changed in the database and the content of the change.

[0058] In the embodiment of the present invention, the Binlog file can record the change information almost at the same time as the event is submitted. When the underlying state changes, the relevant database operation will immediately trigger the Binlog record. Through the efficient Binlog file parsing and event processing mechanism, the console can quickly obtain these changes and update the state, which has the advantage of high efficiency.

[0059] S130, determining whether the event content is related to the console of the load balancing service, and if so, generating a status update request, wherein the status update request includes a data object to be updated and an update attribute;

[0060] After obtaining the event content, since not all data changes are directly related to the state of the console, it is also necessary to filter the time content, filter out the data related to the state of the console, and then synchronize the data to the console.

[0061] Specifically, it is determined whether the data in the event content is related to the console of the load balancing service. If the data in the event content is related to the console of the load balancing service, a status update request is generated according to the data to be updated and the update attribute. The update attribute may be the health status of the backend server, and the data to be updated refers to the changed data that needs to be synchronized to the backend of the console.

[0062] S140: Synchronize the data object and the updated attribute in the console according to the status update request.

[0063] In the embodiment of the present invention, after receiving the status update request, the console synchronizes the data object and the update attribute in the console, and the console updates the status displayed on the console according to the status update request.

[0064] After the Binlog function is enabled through simple configuration in the embodiment of the present invention, the commands and library functions provided by the Binlog function can be used to parse the Binlog file, and the state synchronization logic can be integrated into the backend service of the console, which is simple and convenient.

[0065] The embodiment of the present invention provides a state synchronization method. When state synchronization is performed, if a change operation occurs in the database, a binary log file is generated; the binary log file is parsed to obtain the parsed event content; if it is determined whether the event content is related to the console, a state update data request is generated if it is related; and the data objects and attributes in the console are synchronized according to the state update data request. The embodiment of the present invention records all modification operations in the database through a binary log file, so that every detail of the underlying state change can be fully captured, thereby ensuring the accuracy of the console state, and synchronizing the changed data to the backend server of the console, ensuring the state consistency between the underlying database and the upper-level console.

[0066] In the embodiment of the present invention, when the data status in the underlying database changes, a binary log file record will be triggered immediately. Through the efficient binary log file parsing and event processing mechanism, the console can quickly obtain these changes and update the status; and after the binary log function of the database is enabled through simple configuration, the commands and library functions provided by it can be used to parse the binary log, and the status synchronization logic can be integrated into the back-end service of the console, which has the advantages of high efficiency and convenience.

[0067] It should be noted that if the event content is not related to the console of the load balancing service, the console will not be updated.

[0068] In the embodiment of the present invention, if the event content is not related to the console of the load-bearing Junhe service, there is no need to synchronize the data in the event content to the console, and the data change is not processed.

[0069] As an implementation mode, the step of determining whether the event content is related to the console of the load balancing service includes:

[0070] Determining whether the event content involves the backend server status of the console;

[0071] If the event content is related to the backend server status of the console, it is determined that the event content is related to the console of the load balancing service, and the backend server status includes a health status;

[0072] Otherwise, it is determined that the event content is irrelevant to the console of the load balancing service.

[0073] In the embodiment of the present invention, whether the event content is related to the console of the load balancing service is determined according to whether the event content is related to the backend server status of the console. Specifically, if the event content is related to the backend server status of the console, it can be determined that the event content is related to the console of the load balancing service; if the event content is not related to the backend server status of the console, it can be determined that the event content is not related to the console of the load balancing service.

[0074] Among them, the back-end server status can be the health status of the back-end server, and the health status can be multiple aspects such as the server's hardware operating status, software operating environment, network connection, and application availability. It can be determined based on actual conditions, and the embodiment of the present invention does not make specific limitations on this.

[0075] As an implementation manner, the steps of parsing the binary log file to obtain the parsed event content include:

[0076] According to the format of the binary log file, the binary log file is parsed using a method corresponding to the format.

[0077] In the embodiment of the present invention, after a Binlog event is captured, the event content needs to be parsed, and different parsing methods are used according to the record format of the Binlog file.

[0078] As an example, according to the format of the binary log file, the binary log file is parsed using a method corresponding to the format, the steps include:

[0079] If the format of the binary log file is STATEMENT, the event content is obtained by parsing the database statement;

[0080] If the format of the binary log file is ROW, the event content is obtained by parsing the row data.

[0081] If the binary log file is in STATEMENT format, you need to parse the SQL statement to determine the specific operation on the SLB-related data; if the binary log file is in ROW format, you need to parse the changes in the row data to determine which fields are modified.

[0082] Among them, the binary log file in STATEMENT format mainly records the executed SQL statements. For example, if "UPDATE users SET age=25WHERE id=1" is executed, this SQL statement will be completely recorded in the binary log. Therefore, the SQL statement needs to be parsed during parsing.

[0083] The binary log file in ROW format mainly records the changes of each row of data. For the above UPDATE operation, it will record the row data before and after the update in detail. Therefore, it is necessary to parse the row data during parsing.

[0084] In some embodiments, in step S110, the data change operation occurring in the monitoring database and generating a binary log file comprises:

[0085] S111, receiving and parsing the binary log file through a data synchronization component;

[0086] S112, sending the binary log file to a message queue of a message queue component;

[0087] S113, creating a consumer of a message queue component to capture the binary log file.

[0088] In the embodiment of the present invention, since the database has the Binlog function enabled and configured, a binary log file will be generated after a change operation occurs in the database. In order to capture the binary log file, the binary log file is first received and parsed by the data synchronization component. The data synchronization component can be any component that can receive and parse binary log files, and can be determined according to actual conditions. The embodiment of the present invention does not specifically limit this.

[0089] The data synchronization component can be a Canal component. In the actual implementation process, the Canal component is usually selected as the Binlog client tool. After downloading the Canal component, configure the canal.properties and instance.properties files. In the instance.properties file, you need to specify the relevant information of the database, such as the database host name, port, user name, password, etc. You also need to set the location and format of the Binlog file to be parsed.

[0090] It should be noted that the main function of the Canal component is to disguise itself as a MySQL slave and obtain the binary log of the MySQL master by simulating the MySQL master-slave replication protocol.

[0091] After parsing the binary log file in the embodiment of the present invention, the binary log file is sent to the message queue component and stored in the message queue of the message queue component. The message queue component can be any component that can generate a message queue, which can be determined according to actual conditions, and the embodiment of the present invention does not specifically limit this.

[0092] The message queue component may be a Kafka component. The Binlog file is parsed using the Canal component to obtain the parsed event content, and the Canal component sends the event content to the Kafka component.

[0093] Finally, create a consumer of the Kafka component and use the consumer to capture the binary log file to send the binary log file to the console.

[0094] In the actual implementation process, Kafka is used to generate a status update request and send it to the console. Kafka is a distributed stream processing platform that is mainly used to process large-scale real-time data streams.

[0095] In some embodiments, before the step of monitoring the data change operation occurring in the database, the step further includes:

[0096] The database is controlled to enable a binary log function, and configuration parameters of the binary log file are set in a configuration file of the database.

[0097] In the embodiment of the present invention, before monitoring the change operation of the database, the database is first configured to enable the Binlog function of the database, so that any data change operation of the database will be recorded in the binary log file, which is the Binlog file.

[0098] It is also necessary to set the function parameters of the binary log in the configuration file. The function parameters are parameters related to the binary log, such as the storage path of the binary log, the file name prefix, and the record format of the binary log. The specific parameters can be determined according to the actual situation, and the embodiment of the present invention does not make specific limitations on this.

[0099] In the specific implementation process, relevant parameters are set in the configuration file of the database to determine various information of the binary log. For example, by setting the log-bin parameter, the storage path and file name prefix of the Binlog file can be specified; and the binlog-format parameter can also be configured as needed to determine the record format of the Binlog file. Common record formats include STATEMENT, ROW, and MIXED. In the embodiment of the present invention, the size limit and storage period of the Binlog file are also reasonably set to avoid excessive occupation of disk space.

[0100] In some embodiments, the step of monitoring the data change operation occurring in the database and generating a binary log file comprises:

[0101] If any one of the operations of inserting, updating and deleting occurs in the database, the binary log file is generated, and the binary log file is used to record all modifications to the database.

[0102] The instance state synchronization method proposed in the embodiment of the present invention can effectively ensure the consistency between the console and the underlying state. The Binlog file is a binary file used by databases such as MySQL to record all modifications to the database, including insert, update, delete and other operations. The Binlog file is a transaction log, mainly used for data replication and data recovery.

[0103] In summary, the embodiments of the present invention can ensure data accuracy and integrity, and can improve the real-time and timeliness of the synchronization method, and is easy to integrate and implement.

[0104] Figure 2 A timing diagram of a state synchronization method provided by an embodiment of the present invention, such as Figure 2 As shown, the Binlog function is set and enabled in the database, and when the database data is changed, the data changes are recorded in the Binlog file, and the Binlog file is sent to the Canal component; after receiving the Binlog file, the Canal component parses it to obtain the event content, and determines that the event content is related to the service status of the console backend, and then sends the event content to Kafka; after receiving the event content, Kafka generates a status update request and sends the status update request to the console; the console will construct the status update request and update the status displayed on the console.

[0105] Figure 3 A schematic diagram of the structure of a state synchronization device provided by an embodiment of the present invention is shown in FIG. Figure 3 As shown, the device comprises:

[0106] The change module 310 is used to monitor the data change operations occurring in the database and generate a binary log file;

[0107] The parsing module 320 is used to parse the binary log file to obtain the parsed event content;

[0108] The request module 330 is used to determine whether the event content is related to the console of the load balancing service, and if so, generate a status update request, wherein the status update request includes a data object to be updated and an update attribute;

[0109] The updating module 340 is used to synchronize the data object and the updated attribute in the console according to the status update request.

[0110] This embodiment is a device embodiment corresponding to the above method embodiment, and its implementation process is the same as that of the above method embodiment. For details, please refer to the above method embodiment, and this device embodiment will not elaborate on it.

[0111] As an implementation manner, the request module includes a first request unit and a second request unit, wherein:

[0112] The first request unit is configured to determine that the event content is related to the console of the load balancing service if the event content involves the backend server status of the console;

[0113] The second request unit is configured to determine that the event content is not related to the console of the load balancing service if the event content does not involve the backend server status of the console.

[0114] In some embodiments, the parsing module comprises a parsing unit, wherein:

[0115] The parsing unit is used to parse the binary log file according to the format of the binary log file using a method corresponding to the format.

[0116] As an implementation manner, the parsing unit includes a first parsing subunit and a second parsing subunit, wherein:

[0117] The first parsing subunit is configured to obtain the event content by parsing a database statement if the format of the binary log file is STATEMENT;

[0118] The second parsing subunit is configured to obtain the event content by parsing row data if the format of the binary log file is ROW.

[0119] As an implementation mode, the change module includes a receiving unit, a component unit and a capture unit, wherein:

[0120] The receiving unit is used to receive and parse the binary log file through a data synchronization component;

[0121] The component unit is used to send the binary log file to the message queue of the message queue component;

[0122] The capturing unit is used to create a consumer of a message queue component to capture the binary log file.

[0123] In some embodiments, the state synchronization device further includes a configuration module, wherein:

[0124] The configuration module is used to control the database to enable the binary log function and set the configuration parameters of the binary log file in the configuration file of the database.

[0125] In some embodiments, the state synchronization device further includes a modification module, wherein:

[0126] The modification module is used to generate the binary log file if any one of the insertion, update and deletion operations occurs in the database, and the binary log file is used to record all modifications to the database.

[0127] Based on the above state synchronization method, an embodiment of the present invention further provides a computer device, the computer device includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus;

[0128] Memory, used to store computer programs;

[0129] The processor is used to implement the steps of the above-mentioned state synchronization method when executing the program stored in the memory.

[0130] For other details about the processor in the above-mentioned computer device implementing the above-mentioned technical solution, please refer to the description of the state synchronization method provided in the above-mentioned invention embodiment, which will not be repeated here.

[0131] Among them, the processor can also be called CPU (Central Processing Unit), the processor may be an integrated circuit chip with signal processing capabilities; the processor can also be a general-purpose processor, DSP (Digital Signal Process), ASIC (Application Specific Integrated Circuit), FPGA (Field Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, among which the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0132] The embodiment of the present invention also provides a computer-readable storage medium, on which a readable computer program is stored; wherein the computer program can be stored in the above storage medium in the form of a software product, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, magnetic disk or optical disk, ROM (Read-Only Memory), RAM (Random Access Memory) and other media that can store program codes, or terminal devices such as computers, servers, mobile phones, and tablets.

[0133] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0134] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0135] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0136] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0137] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

[0138] The technical solution provided by the present application is introduced in detail above. The principles and implementation methods of the present application are explained by using specific examples in the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

[0139] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0140] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0141] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0142] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0143] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A state synchronization method, characterized in that: The method comprises: Monitor data change operations in the database and generate binary log files; Parsing the binary log file to obtain parsed event content; Determine whether the event content is related to the console of the load balancing service, and if so, generate a status update request, wherein the status update request includes a data object to be updated and an update attribute; The data object and the updated attribute in the console are synchronized according to the status update request.

2. The state synchronization method according to claim 1, characterized in that: The step of determining whether the event content is related to the console of the load balancing service comprises: Determining whether the event content involves the backend server status of the console; If the event content is related to the backend server status of the console, determining that the event content is related to the console of the load balancing service; Otherwise, it is determined that the event content is irrelevant to the console of the load balancing service.

3. The state synchronization method according to claim 1, characterized in that: The step of parsing the binary log file to obtain the parsed event content includes: According to the format of the binary log file, the binary log file is parsed using a method corresponding to the format.

4. The state synchronization method according to claim 3, characterized in that: The steps of parsing the binary log file according to the format of the binary log file using a method corresponding to the format include: If the format of the binary log file is STATEMENT, the event content is obtained by parsing the database statement; If the format of the binary log file is ROW, the event content is obtained by parsing the row data.

5. The state synchronization method according to claim 1, characterized in that: The steps of monitoring the data change operation occurring in the database and generating a binary log file include: Receiving and parsing the binary log file through a data synchronization component; Sending the binary log file to a message queue of a message queue component; Create a consumer of the message queue component to capture the binary log file.

6. The state synchronization method according to any one of claims 1 to 5, characterized in that: Before the step of monitoring the data change operation occurring in the database, the step further includes: The database is controlled to enable a binary log function, and configuration parameters of the binary log file are set in a configuration file of the database.

7. The state synchronization method according to any one of claims 1 to 5, characterized in that: The steps of monitoring the data change operation occurring in the database and generating a binary log file include: If any one of the operations of inserting, updating and deleting occurs in the database, the binary log file is generated, and the binary log file is used to record all modifications to the database.

8. A state synchronization device, characterized in that: The state synchronization device comprises: The change module is used to monitor data change operations in the database and generate binary log files; A parsing module, used to parse the binary log file to obtain parsed event content; A request module, used to determine whether the event content is related to the console of the load balancing service, and if so, generate a status update request, wherein the status update request includes a data object to be updated and an update attribute; An updating module is used to synchronize the data object and the updated attribute in the console according to the status update request.

9. A computer device, characterized in that: The device includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory, used to store computer programs; A processor, for implementing the steps of the state synchronization method described in any one of claims 1 to 7 when executing a program stored in a memory.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the state synchronization method according to any one of claims 1 to 7 are implemented.