CN112818059B - Information real-time synchronization method and device based on container release platform - Google Patents

Information real-time synchronization method and device based on container release platform Download PDF

Info

Publication number
CN112818059B
CN112818059B CN202110106917.XA CN202110106917A CN112818059B CN 112818059 B CN112818059 B CN 112818059B CN 202110106917 A CN202110106917 A CN 202110106917A CN 112818059 B CN112818059 B CN 112818059B
Authority
CN
China
Prior art keywords
container unit
unit information
information
database
container
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
CN202110106917.XA
Other languages
Chinese (zh)
Other versions
CN112818059A (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.)
Bigo Technology Pte Ltd
Original Assignee
Bigo Technology Pte 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 Bigo Technology Pte Ltd filed Critical Bigo Technology Pte Ltd
Priority to CN202110106917.XA priority Critical patent/CN112818059B/en
Publication of CN112818059A publication Critical patent/CN112818059A/en
Application granted granted Critical
Publication of CN112818059B publication Critical patent/CN112818059B/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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Landscapes

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

Abstract

The embodiment of the application discloses a real-time information synchronization method and device based on a container release platform. According to the embodiment of the application, a monitoring process receives a container unit change event sent by a cluster in a container management platform, obtains container unit information in the container unit change event, and correspondingly updates the container unit information stored in a database according to the container unit information; and inquiring whether the last published container unit information in the cluster is consistent with the corresponding container unit information in the database or not through a polling process, and correspondingly updating the container unit information stored in the database according to the last published container unit information when the last published container unit information is inconsistent with the corresponding container unit information. By adopting the technical means, the asynchronous message processing mechanism of the monitoring process and the active database inquiring mechanism of the polling process are combined, so that the instantaneity, the sequence and the reliability of the container unit information in the database are ensured.

Description

Information real-time synchronization method and device based on container release platform
Technical Field
The embodiment of the application relates to the technical field of containers, in particular to a real-time information synchronization method and device based on a container release platform.
Background
K8S (kubernetes) is a portable, extensible open source platform for managing containerized workloads and services, facilitating declarative configuration and automation. The K8S redefines the deployment, expansion and management modes of the application program, and more people are thrown into the arms of the container technology along with the rapid development and gradual maturation of the K8S. Since it is not realistic to let every developer know the various operation commands of K8S, a general distribution platform has been developed.
After the platform release, the user is concerned about whether the program is running properly. The corresponding concept of the program in the K8S is POD, and the POD is the minimum unit which can be created and deployed by the K8S. In order to accurately grasp the running state of the POD, it is indispensable to display details of POD information, however, how to display specifically, there is a difference in each release platform. The existing method is to query the POD running state in the K8S cluster in real time or synchronize POD information to a database at regular time, and query the POD running state according to the POD information in the database. The real-time query method has the advantages of accurate result, low overall query speed, fast query speed after database information synchronization, poor timeliness and incapability of acquiring the running state of the POD in real time.
Disclosure of Invention
The embodiment of the application provides a real-time information synchronization method and device based on a container release platform, which can also ensure that the acquired container unit information has higher timeliness when the query speed of the container unit information is improved.
In a first aspect, an embodiment of the present application provides a method for real-time synchronization of information based on a container publishing platform, including:
Receiving a container unit change event sent by a cluster in a container management platform through a monitoring process, acquiring container unit information in the container unit change event, and correspondingly updating the container unit information stored in a database according to the container unit information;
And inquiring whether the last published container unit information in the cluster is consistent with the corresponding container unit information in the database through a polling process, and updating the container unit information stored in the database according to the last published container unit information when the last published container unit information is inconsistent with the corresponding container unit information.
In a second aspect, an embodiment of the present application provides an information real-time synchronization device based on a container publishing platform, including:
the monitoring module is configured to receive container unit change events sent by the clusters in the container management platform through a monitoring process, acquire container unit information in the container unit change events, and correspondingly update the container unit information stored in the database according to the container unit information;
The active polling module is configured to query whether the last published container unit information in the cluster is consistent with the corresponding container unit information in the database through a polling process, and correspondingly update the container unit information stored in the database according to the last published container unit information when the last published container unit information is inconsistent with the corresponding container unit information.
In a third aspect, an embodiment of the present application provides an electronic device, including:
a memory and one or more processors;
the memory is used for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method for real-time synchronization of information based on a container distribution platform as described in the first aspect.
In a fourth aspect, embodiments of the present application provide a storage medium containing computer executable instructions which, when executed by a computer processor, are used to perform the method of real-time synchronization of information based on a container distribution platform as described in the first aspect.
According to the embodiment of the application, a monitoring process receives a container unit change event sent by a cluster in a container management platform, acquires container unit information in the container unit change event, and correspondingly updates the container unit information stored in a database according to the container unit information; and inquiring whether the last published container unit information in the cluster is consistent with the corresponding container unit information in the database through a polling process, and updating the container unit information stored in the database according to the last published container unit information when the last published container unit information is inconsistent with the corresponding container unit information. By adopting the technical means, an asynchronous message processing mechanism of the monitoring process and a database actively inquiring mechanism of the polling process are combined. The monitoring process is responsible for continuously monitoring the change event pushed by the cluster, analyzing the event update database, ensuring that the container unit information changed in the database is updated in real time, and the polling process is responsible for updating the database when the container unit information in the spam query database is inconsistent with the container unit information released last time in the cluster, and ensuring the instantaneity, the sequence and the reliability of the container unit information in the database. The database in the embodiment of the application is used for inquiring the container unit information, and when the inquiring speed of the container unit information is improved, the obtained container unit information can be ensured to have higher timeliness.
Drawings
Fig. 1 is a flowchart of a method for synchronizing information in real time based on a container publishing platform according to an embodiment of the present application;
FIG. 2 is a flowchart of updating a database based on a monitoring process in accordance with a first embodiment of the present application;
FIG. 3 is a flowchart of updating a database based on a polling process in accordance with a first embodiment of the application;
FIG. 4 is a flow chart of container unit publication in accordance with a first embodiment of the present application;
FIG. 5 is a schematic diagram showing information transmission of a container unit according to a first embodiment of the present application;
Fig. 6 is a schematic structural diagram of an information real-time synchronization device based on a container publishing platform according to a second embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to a third embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the following detailed description of specific embodiments of the present application is given with reference to the accompanying drawings. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the matters related to the present application are shown in the accompanying drawings. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart depicts operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently, or at the same time. Furthermore, the order of the operations may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figures. The processes may correspond to methods, functions, procedures, subroutines, and the like.
The application provides a real-time information synchronization method and device based on a container release platform, which aim to combine an asynchronous message processing mechanism of a monitoring process with an active database query mechanism of a polling process. The monitoring process is responsible for continuously monitoring the change event pushed by the cluster, analyzing the event update database, ensuring that the container unit information changed in the database is updated in real time, and the polling process is responsible for updating the database when the container unit information in the spam query database is inconsistent with the container unit information released last time in the cluster, and ensuring the instantaneity, the sequence and the reliability of the container unit information in the database. The database in the embodiment of the application is used for inquiring the container unit information, and when the inquiring speed of the container unit information is improved, the obtained container unit information can be ensured to have higher timeliness. Compared with the traditional container unit information query mode, the method queries the running state of the container units in the cluster in real time or synchronizes the container unit information to the database at fixed time, and queries the running state of the container units according to the container unit information in the database. The real-time query mode has accurate results but low overall query speed, and the database information is synchronized and then queried quickly but with poor timeliness, so that the running state of the container unit cannot be obtained in real time. Based on the above, the method and the device for synchronizing the information based on the container release platform in real time can ensure that the acquired container unit information has higher timeliness when the query speed of the container unit information is improved.
Embodiment one:
Fig. 1 shows a flowchart of a real-time information synchronization method based on a container release platform according to a first embodiment of the present application, where the real-time information synchronization method based on a container release platform provided in this embodiment may be executed by a real-time information synchronization device based on a container release platform, where the real-time information synchronization device based on a container release platform may be implemented by software and/or hardware, and the real-time information synchronization device based on a container release platform may be formed by two or more physical entities or may be formed by one physical entity. In general, the information real-time synchronization device based on the container release platform is the container release platform.
The following description will be made taking a container release platform as an example of a main body for executing the information real-time synchronization method based on the container release platform. Referring to fig. 1, the method for synchronizing information in real time based on a container publishing platform specifically includes:
s110, receiving a container unit change event sent by a cluster in a container management platform through a monitoring process, acquiring container unit information in the container unit change event, and correspondingly updating the container unit information stored in a database according to the container unit information.
Specifically, container unit change events of all clusters in a container management platform are registered through a monitoring process, and when the container unit state of the clusters is monitored to change, the container unit change events sent by the clusters are received. The container unit is a POD, the container management platform is a K8S, the monitoring process registers POD change events in all clusters of the K8S respectively, and when the working state of the POD in a certain cluster changes, the monitoring process receives the POD change event sent by the cluster, and can analyze POD information from the POD change event.
Further, the POD information stored in the database is correspondingly updated based on the POD information. Specifically, referring to fig. 2, fig. 2 is a flowchart of updating a database based on a monitoring process in a first embodiment of the present application. As shown in fig. 2, updating the database flow based on the monitoring process includes:
S1101, inquiring the last published container unit information of the cluster based on the publication identification, inquiring whether the completion state of the last published container unit information is completed, and inquiring whether a database records corresponding container unit information according to the publication identification and the container unit name if the completion state is completed;
S1102, if the database does not record the corresponding container unit information, the last-time released container unit information is recorded in the database, and if the database records the corresponding container unit information, the version number of the last-time released container unit information is compared with the version number of the container unit information in the database;
S1103, if the version number of the last released container unit information is larger than the version number of the container unit information in the database, inquiring whether the container unit information in the database is consistent with the last released container unit information, and if the last released container unit information is inconsistent with the last released container unit information, recording the last released container unit information in the database.
Specifically, the POD information includes a release identifier of the POD, a POD name, a working state, and a resource version number. Inquiring release information released last time in the K8S cluster according to the release identification of the POD, wherein the release information comprises at least one POD information, inquiring whether the completion state of the release information is completed, if the completion state of the release information is incomplete, indicating that the release information is not processed by the K8S cluster, and not processing the release information. If the completion state of the release information is completed, the release information is completely processed by the K8S cluster, whether the POD information with the same name is recorded in the database is queried according to the POD name, and if the POD information with the same name is not recorded in the database, the POD information is recorded in the database. If the POD information with the same name is recorded in the database, comparing whether the POD resource version number analyzed by the monitoring process is larger than the POD information in the database, and if not, not processing. If so, comparing whether the POD information analyzed by the monitoring process is consistent with the POD information in the database, and if so, not updating the POD information in the database. If not, the POD working state in the database is updated to be synchronous with the POD working state analyzed by the monitoring process, so that the POD working state in the database is consistent with the POD working state in the cluster, and the instantaneity of the POD information in the database is ensured. The completion status of the POD information is represented by the completion status of the delivery information to which the POD information belongs.
It can be understood that the cluster issues PODs according to the POD operation sequence in the issue information, so that the POD resource version number in the issue information issued by the cluster last time is the latest resource version number, and when the POD with the latest version number is operated, the PODs with other version numbers in the cluster behind are generally in a stop state, so as to save operation resources, and only the POD information in the issue information issued by the cluster last time needs to be concerned. Therefore, when the POD resource version analyzed by the monitoring process is smaller than the POD resource version in the database, the POD change event is indicated to be unnecessary to process, and the sequency of the POD information in the database is ensured.
In addition, if the monitoring process hangs up and then registers all POD change events in the cluster again, at this time, the K8S cluster will send all current POD change events to the monitoring process, so that the monitoring process can continuously update the corresponding POD information in the database according to the POD change events, and the reliability of the POD information in the database is ensured.
And S120, inquiring whether the last published container unit information in the cluster is consistent with the corresponding container unit information in the database through a polling process, and correspondingly updating the container unit information stored in the database according to the last published container unit information when the last published container unit information is inconsistent with the corresponding container unit information.
Specifically, referring to fig. 3, fig. 3 is a flowchart of updating a database based on a polling procedure in the first embodiment of the present application. As shown in fig. 3, updating the database flow based on the polling process includes:
S1201, grouping the container unit information in the cluster according to the release identification, and inquiring the container unit information released by each group for the last time through a polling process;
s1202, comparing the version number of the last-released container unit information with the version number of the container unit information in the database, and if the version number of the last-released container unit information is greater than the version number of the container unit information in the database, acquiring corresponding container unit information from the cluster;
S1203, inquiring whether corresponding container unit information is recorded in a database according to the release identification and the container unit name of the last released container unit information, and if the corresponding container unit information is not recorded in the database, recording the last released container unit information into the database;
And S1204, if the last published container unit information is recorded in the database, inquiring whether the last published container unit information is consistent with the container unit information in the database, and if the last published container unit information is inconsistent with the container unit information in the database, recording the last published container unit information in the database.
Specifically, the POD information belonging to the same release information is divided into a group according to the release identification of the POD, the POD information in the release information released last time in each group is queried through a polling process, the POD resource version number is compared with the POD resource version number in the database, and if the POD resource version number is smaller than the POD resource version number in the database, no processing is performed. If the POD resource version number is larger than the POD resource version number in the database, determining whether the POD information with the same name is recorded in the database according to the POD name. If the POD information is not recorded in the database, the POD information in the last released release information is recorded in the database, if the POD information is recorded in the database, whether the POD information in the last released release information is consistent with the POD information in the database is inquired, and if the POD information is inconsistent with the POD information in the database, the POD working state in the database is modified into the POD working state in the last released release information.
Further, the polling process is used for inquiring the container unit information which is not released last time in each group, comparing the container unit information with the corresponding container unit information in the database, and if the working state of the container unit information in the database is in operation, setting the working state of the container unit information in the database as invalid. Specifically, if the POD information recorded in the database is not found in the release information released last in each packet of the K8S cluster by the polling process, the POD working state recorded in the database is set to be invalid. It can be understood that if the POD information in the last published release information in each packet of the K8S cluster has the latest resource version number, when the POD of the latest version runs in the K8S cluster, the PODs with the remaining resource version numbers in the K8S cluster that are behind are generally in a stopped state, so as to save running resources. Therefore, the POD working state corresponding to the POD in the database which has stopped running needs to be updated to be consistent with the POD working state in the K8S cluster.
Based on the active polling of the database, the user only needs to pay attention to the release information released last time in each group, so that all the real-time POD information can be obtained, the convenience of the user in inquiring the real-time running state of the POD is improved, and the instantaneity of the POD information in the database is also ensured. In addition, if the monitoring process is not restarted successfully for a long time, and the database loses a small amount of POD information, the polling process can synchronize the POD information in the K8S to the database.
Further, before synchronizing the POD information in the K8S and the database, the POD information configured by the user needs to be acquired, and a POD release request is submitted to the K8S, so that the K8S releases the corresponding POD. Specifically, referring to fig. 4, fig. 4 is a flowchart of a container unit issuing process according to a first embodiment of the present application. As shown in fig. 4, the container unit issuing flow includes:
S210, acquiring container unit information and release operation information configured by a release page, and generating release information according to the container unit information and the release operation information, wherein the release information comprises at least one container unit information, and the release operation information and the container unit information are associated through a release identifier and an operation number;
S220, determining corresponding container unit information according to the minimum operation number of the release operation information, generating a release creation request according to the container unit information, and sending the release creation request to a container management platform so that the container management platform creates a corresponding container unit.
S230, detecting whether the number of the container units in operation of the container management platform is consistent with the expected number in the corresponding release operation information, if so, recording the container unit information into a database, and marking the working state of the container unit information as in operation.
S240, if the number of the container units is inconsistent with the expected number in the corresponding release operation information after the preset time, recording the container unit information into a database, marking the working state of the container unit information as failure, and marking the completion state in the release information corresponding to the release operation information as failure.
S250, marking the state of the release information as successful after the working states in the release operation information associated with the release information are marked as successful.
Specifically, the POD information configured by the user on the release page of the container release platform and the release operation corresponding to the POD are obtained, release information is generated based on the POD information and the POD release operation, and the release information comprises a release identifier, the POD information and an operation number corresponding to the POD. According to POD information corresponding to the operation numbers from small to large, a POD creation request is generated, the POD creation request is sent to the K8S, the K8S cluster runs the corresponding PODs, and one operation number can correspond to a plurality of PODs, namely, the K8S cluster runs a plurality of PODs at the same time. After the K8S issues the PODs, it is required to query whether the number of PODs running in the K8S cluster is consistent with the number of PODs corresponding to the operation number, and if so, it indicates that the K8S has issued the PODs corresponding to the operation number. If the number of PODs running in the K8S cluster is not consistent with the number of PODs corresponding to the operation number after three minutes, the PODs corresponding to the operation number can be considered to be failed to be issued, POD information is recorded in a database, and the working state of the PODs in the database is set to be failed. It will be appreciated that K8S pulling mirror and schedule, etc. requires some time, but typically no more than three minutes. Further, the completion status of the published information is set to failed, wherein both the failed and successful completion status are completed status. If all PODs corresponding to one operation number are successfully issued, continuing to generate a corresponding POD creation request based on the next operation number of the operation number, and if all PODs in the issue information are successfully issued, setting the completion state of the issue information to be successful. Further, for the release information with failed release, the completion status of the release information may be set in a retry, so that the K8S reissues the release information once.
Specifically, referring to fig. 5, fig. 5 is a schematic diagram illustrating information transmission of a container unit according to a first embodiment of the present application. As shown in fig. 5, the user configures POD information on the release page of the container release platform, and after the container release platform obtains the POD information configured by the user, correspondingly generates a POD creation request, sends the POD creation request to the K8S, and after the K8S releases the corresponding POD, the POD operates in the K8S cluster. And recording the POD information into a database, and correspondingly updating the working state of the POD in the database after the success or failure of releasing the POD by the K8S. Further, the container release platform is provided with a monitoring process and a polling process, all POD change events in the K8S cluster are registered through the monitoring process, when the working state of the POD in the K8S cluster changes, the K8S cluster pushes the corresponding POD change event to the monitoring process, the monitoring process analyzes the POD change event to obtain POD information, the last release information corresponding to the POD release identification is determined, and when the completion state of the release information is finished and the POD resource version number is larger than the corresponding POD resource version number in the database, the POD information analyzed by the monitoring process is recorded in the database. Actively inquiring the release information released last time by each group in the K8S cluster through a polling process, and recording the actively inquired POD information into the database when the completion state of the release information is completed and the POD resource version number is greater than the corresponding POD resource version number in the database.
In summary, receiving a container unit change event sent by a cluster in a container management platform through a monitoring process, acquiring container unit information in the container unit change event, and correspondingly updating the container unit information stored in a database according to the container unit information; and inquiring whether the last published container unit information in the cluster is consistent with the corresponding container unit information in the database through a polling process, and updating the container unit information stored in the database according to the last published container unit information when the last published container unit information is inconsistent with the corresponding container unit information. By adopting the technical means, an asynchronous message processing mechanism of the monitoring process and a database actively inquiring mechanism of the polling process are combined. The monitoring process is responsible for continuously monitoring the change event pushed by the cluster, analyzing the event update database, ensuring that the container unit information changed in the database is updated in real time, and the polling process is responsible for updating the database when the container unit information in the spam query database is inconsistent with the container unit information released last time in the cluster, and ensuring the instantaneity, the sequence and the reliability of the container unit information in the database. The database in the embodiment of the application is used for inquiring the container unit information, and when the inquiring speed of the container unit information is improved, the obtained container unit information can be ensured to have higher timeliness.
Embodiment two:
Based on the above embodiments, fig. 6 is a schematic structural diagram of an information real-time synchronization device based on a container publishing platform according to a second embodiment of the present application. Referring to fig. 6, the real-time information synchronization device based on the container publishing platform provided in this embodiment specifically includes: a monitoring module 21 and a active polling module 22.
The monitoring module 21 is configured to receive a container unit change event sent by a cluster in the container management platform through a monitoring process, acquire container unit information in the container unit change event, and correspondingly update the container unit information stored in the database according to the container unit information;
The active polling module 22 is configured to query whether the last published container unit information in the cluster and the corresponding container unit information in the database are consistent through a polling process, and correspondingly update the container unit information stored in the database according to the last published container unit information when the last published container unit information and the corresponding container unit information are inconsistent.
Receiving a container unit change event sent by a cluster in a container management platform through a monitoring process, acquiring container unit information in the container unit change event, and correspondingly updating the container unit information stored in a database according to the container unit information; and inquiring whether the last published container unit information in the cluster is consistent with the corresponding container unit information in the database through a polling process, and updating the container unit information stored in the database according to the last published container unit information when the last published container unit information is inconsistent with the corresponding container unit information. By adopting the technical means, an asynchronous message processing mechanism of the monitoring process and a database actively inquiring mechanism of the polling process are combined. The monitoring process is responsible for continuously monitoring the change event pushed by the cluster, analyzing the event update database, ensuring that the container unit information changed in the database is updated in real time, and the polling process is responsible for updating the database when the container unit information in the spam query database is inconsistent with the container unit information released last time in the cluster, and ensuring the instantaneity, the sequence and the reliability of the container unit information in the database. The database in the embodiment of the application is used for inquiring the container unit information, and when the inquiring speed of the container unit information is improved, the obtained container unit information can be ensured to have higher timeliness.
The information real-time synchronization device based on the container release platform provided by the embodiment II of the application can be used for executing the information real-time synchronization method based on the container release platform provided by the embodiment I, and has corresponding functions and beneficial effects.
Embodiment III:
An electronic device according to a third embodiment of the present application, referring to fig. 7, includes: processor 31, memory 32, communication module 33, input device 34 and output device 35. The number of processors in the electronic device may be one or more and the number of memories in the electronic device may be one or more. The processor, memory, communication module, input device, and output device of the electronic device may be connected by a bus or other means.
The memory 32 is used as a computer readable storage medium for storing software programs, computer executable programs and modules, and program instructions/modules corresponding to the method for real-time synchronization of information based on a container release platform according to any embodiment of the present application (e.g., the monitoring module 21 and the active polling module 22 in the device for real-time synchronization of information based on a container release platform). The memory may mainly include a memory program area and a memory data area, wherein the memory program area may store an operating system, at least one application program required for a function; the storage data area may store data created according to the use of the device, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some examples, the memory may further include memory remotely located with respect to the processor, the remote memory being connectable to the device through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The communication module 33 is used for data transmission.
The processor 31 executes various functional applications of the device and data processing by running software programs, instructions and modules stored in the memory, that is, implements the above-described real-time synchronization method of information based on the container distribution platform.
The input means 34 may be used to receive entered numeric or character information and to generate key signal inputs related to user settings and function control of the device. The output means 35 may comprise a display device such as a display screen.
The electronic device provided by the above embodiment can be used for executing the information real-time synchronization method based on the container release platform provided by the above embodiment, and has corresponding functions and beneficial effects.
Embodiment four:
The embodiment of the application also provides a storage medium containing computer executable instructions, which when executed by a computer processor, are used for executing a real-time information synchronization method based on a container release platform, the real-time information synchronization method based on the container release platform comprises the following steps: receiving a container unit change event sent by a cluster in a container management platform through a monitoring process, acquiring container unit information in the container unit change event, and correspondingly updating the container unit information stored in a database according to the container unit information; and inquiring whether the last published container unit information in the cluster is consistent with the corresponding container unit information in the database through a polling process, and updating the container unit information stored in the database according to the last published container unit information when the last published container unit information is inconsistent with the corresponding container unit information.
Storage media-any of various types of memory devices or storage devices. The term "storage medium" is intended to include: mounting media such as CD-ROM, floppy disk or tape devices; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, lanbas (Rambus) RAM, etc.; nonvolatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in a first computer system in which the program is executed, or may be located in a second, different computer system connected to the first computer system through a network such as the internet. The second computer system may provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media residing in different locations (e.g., in different computer systems connected by a network). The storage medium may store program instructions (e.g., embodied as a computer program) executable by one or more processors.
Of course, the storage medium containing the computer executable instructions provided by the embodiment of the present application is not limited to the method for real-time synchronization of information based on the container release platform, and may also perform the related operations in the method for real-time synchronization of information based on the container release platform provided by any embodiment of the present application.
The real-time information synchronization device, the storage medium and the electronic device based on the container release platform provided in the foregoing embodiments may perform the real-time information synchronization method based on the container release platform provided in any embodiment of the present application, and technical details not described in detail in the foregoing embodiments may refer to the real-time information synchronization method based on the container release platform provided in any embodiment of the present application.
The foregoing description is only of the preferred embodiments of the application and the technical principles employed. The present application is not limited to the specific embodiments described herein, but is capable of numerous modifications, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the application. Therefore, while the application has been described in connection with the above embodiments, the application is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit of the application, the scope of which is set forth in the following claims.

Claims (11)

1. The real-time information synchronization method based on the container release platform is characterized by comprising the following steps of:
Receiving a container unit change event sent by a cluster in a container management platform through a monitoring process, acquiring container unit information in the container unit change event, and correspondingly updating the container unit information stored in a database according to the container unit information; the container unit information comprises a release identifier, wherein the release identifier is used for inquiring the container unit information released by the cluster for the last time, and the container unit information released by the last time is used for correspondingly updating the container unit information stored in the database;
And inquiring whether the last published container unit information in the cluster is consistent with the corresponding container unit information in the database through a polling process, and updating the container unit information stored in the database according to the last published container unit information when the last published container unit information is inconsistent with the corresponding container unit information.
2. The method of claim 1, wherein the receiving, by the monitoring process, the container unit change event sent by the cluster in the container management platform, comprises:
And registering container unit change events of all clusters in a container management platform by a monitoring process, and receiving the container unit change events sent by the clusters when the container unit state of the clusters is monitored to change.
3. The method of claim 2, wherein the container unit information includes a container unit name, a completion status, and a version number, and wherein the correspondingly updating the container unit information stored in the database according to the container unit information includes:
Inquiring the last published container unit information of the cluster based on the publication identification, inquiring whether the completion state of the last published container unit information is completed or not, and inquiring whether a database records corresponding container unit information or not according to the publication identification and the container unit name if the completion state is completed;
if the database does not record the corresponding container unit information, the last-time released container unit information is recorded in the database, and if the database records the corresponding container unit information, the version number of the last-time released container unit information is compared with the version number of the container unit information in the database;
If the version number of the last released container unit information is larger than that of the container unit information in the database, inquiring whether the container unit information in the database is consistent with the last released container unit information, and if the last released container unit information is inconsistent with the last released container unit information, recording the last released container unit information in the database.
4. A method according to claim 3, wherein the querying, through a polling process, whether the last published container unit information in the cluster and the corresponding container unit information in the database are consistent, and when the last published container unit information and the corresponding container unit information are inconsistent, correspondingly updating the container unit information stored in the database according to the last published container unit information includes:
Grouping the container unit information in the cluster according to the release identification, and inquiring the container unit information released by each group for the last time through a polling process;
Comparing the version number of the last-released container unit information with the version number of the container unit information in the database, and if the version number of the last-released container unit information is larger than the version number of the container unit information in the database, acquiring the corresponding container unit information from the cluster;
inquiring whether corresponding container unit information is recorded in a database according to the release identification and the container unit name of the last released container unit information, and if the corresponding container unit information is not recorded in the database, recording the last released container unit information into the database;
If the last published container unit information is recorded in the database, inquiring whether the last published container unit information is consistent with the container unit information in the database, and if the last published container unit information is inconsistent with the container unit information in the database, recording the last published container unit information in the database.
5. The method of claim 4, wherein the container unit information further comprises an operational status;
Correspondingly, after the querying whether the container unit information is consistent with the corresponding container unit information in the database, if the container unit information is inconsistent with the corresponding container unit information, recording the container unit information into the database, and further comprising:
And inquiring the container unit information which is not released last time by each group through a polling process, comparing the container unit information with the corresponding container unit information in the database, and if the working state of the container unit information in the database is in operation, setting the working state of the container unit information in the database as invalid.
6. The method of claim 1, further comprising, prior to said receiving, by the monitoring process, a container unit change event sent by the cluster in the container management platform:
Acquiring container unit information and release operation information configured by a release page, and generating release information according to the container unit information and the release operation information, wherein the release information comprises at least one container unit information, and the release operation information and the container unit information are associated through a release identifier and an operation number;
And determining corresponding container unit information according to the minimum operation number of the release operation information, generating a release creation request according to the container unit information, and sending the release creation request to a container management platform so as to enable the container management platform to create a corresponding container unit.
7. The method of claim 6, further comprising, after said generating a container management platform publication request from said container unit information and sending said container management platform publication request to a container management platform:
Detecting whether the number of the container units in the operation of the container management platform is consistent with the expected number in the corresponding release operation information, if so, recording the container unit information into a database, and marking the working state of the container unit information as the operation;
if the number of the container units is inconsistent with the expected number in the corresponding release operation information after the preset time, recording the container unit information into a database, marking the working state of the container unit information as failure, and marking the completion state in the release information corresponding to the release operation information as failure.
8. The method of claim 7, further comprising, after said recording said container unit information to a database and marking said operational status in said published operation information as successful:
And marking the completion state of the release information as successful after the working states in the release operation information associated with the release information are marked as successful.
9. An information real-time synchronization device based on a container release platform is characterized by comprising:
The monitoring module is configured to receive container unit change events sent by the clusters in the container management platform through a monitoring process, acquire container unit information in the container unit change events, and correspondingly update the container unit information stored in the database according to the container unit information; the container unit information comprises a release identifier, wherein the release identifier is used for inquiring the container unit information released by the cluster for the last time, and the container unit information released by the last time is used for correspondingly updating the container unit information stored in the database;
The active polling module is configured to query whether the last published container unit information in the cluster is consistent with the corresponding container unit information in the database through a polling process, and correspondingly update the container unit information stored in the database according to the last published container unit information when the last published container unit information is inconsistent with the corresponding container unit information.
10. An electronic device, comprising:
a memory and one or more processors;
the memory is used for storing one or more programs;
The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the container-distribution-platform-based information real-time synchronization method of any of claims 1-8.
11. A storage medium containing computer executable instructions which, when executed by a computer processor, are for performing the real-time synchronization of information based on a container distribution platform as claimed in any one of claims 1 to 8.
CN202110106917.XA 2021-01-27 2021-01-27 Information real-time synchronization method and device based on container release platform Active CN112818059B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110106917.XA CN112818059B (en) 2021-01-27 2021-01-27 Information real-time synchronization method and device based on container release platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110106917.XA CN112818059B (en) 2021-01-27 2021-01-27 Information real-time synchronization method and device based on container release platform

Publications (2)

Publication Number Publication Date
CN112818059A CN112818059A (en) 2021-05-18
CN112818059B true CN112818059B (en) 2024-05-17

Family

ID=75859529

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110106917.XA Active CN112818059B (en) 2021-01-27 2021-01-27 Information real-time synchronization method and device based on container release platform

Country Status (1)

Country Link
CN (1) CN112818059B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011019161A (en) * 2009-07-10 2011-01-27 Fujitsu Ltd Database access program, data acquisition apparatus and database access method
CN105095313A (en) * 2014-05-22 2015-11-25 阿里巴巴集团控股有限公司 Data access method and equipment
CN106970974A (en) * 2017-03-27 2017-07-21 车智互联(北京)科技有限公司 A kind of APP low discharges data update system and method based on version
CN107665227A (en) * 2017-04-10 2018-02-06 平安科技(深圳)有限公司 A kind of data version control method and versions of data controller
CN109063066A (en) * 2018-07-20 2018-12-21 中国邮政储蓄银行股份有限公司 Data query method and device, data management system
CN109992415A (en) * 2019-03-15 2019-07-09 上海拍拍贷金融信息服务有限公司 A kind of container dispatching method and scheduling system
CN110069500A (en) * 2019-04-23 2019-07-30 东华大学 A kind of non-relational database dynamic hybrid index method
CN110572464A (en) * 2019-09-12 2019-12-13 北京浪潮数据技术有限公司 Bottom layer resource state synchronization method and device, cloud platform system and storage medium
CN110609844A (en) * 2018-05-29 2019-12-24 优信拍(北京)信息科技有限公司 Data updating method, device and system
CN110750497A (en) * 2019-10-29 2020-02-04 山东易华录信息技术有限公司 Data scheduling system
CN111414403A (en) * 2020-03-20 2020-07-14 腾讯科技(深圳)有限公司 Data access method and device and data storage method and device
CN111610989A (en) * 2020-06-17 2020-09-01 中国人民解放军国防科技大学 Application release/update method and system for offline container cloud environment
CN111708795A (en) * 2020-06-22 2020-09-25 中国平安财产保险股份有限公司 Object identification generation method, object identification updating device, computer equipment and medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8521703B2 (en) * 2010-11-05 2013-08-27 International Business Machines Corporation Multiple node/virtual input/output (I/O) server (VIOS) failure recovery in clustered partition mobility
US11640374B2 (en) * 2016-06-22 2023-05-02 Nasuni Corporation Shard-level synchronization of cloud-based data store and local file systems

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011019161A (en) * 2009-07-10 2011-01-27 Fujitsu Ltd Database access program, data acquisition apparatus and database access method
CN105095313A (en) * 2014-05-22 2015-11-25 阿里巴巴集团控股有限公司 Data access method and equipment
CN106970974A (en) * 2017-03-27 2017-07-21 车智互联(北京)科技有限公司 A kind of APP low discharges data update system and method based on version
CN107665227A (en) * 2017-04-10 2018-02-06 平安科技(深圳)有限公司 A kind of data version control method and versions of data controller
CN110609844A (en) * 2018-05-29 2019-12-24 优信拍(北京)信息科技有限公司 Data updating method, device and system
CN109063066A (en) * 2018-07-20 2018-12-21 中国邮政储蓄银行股份有限公司 Data query method and device, data management system
CN109992415A (en) * 2019-03-15 2019-07-09 上海拍拍贷金融信息服务有限公司 A kind of container dispatching method and scheduling system
CN110069500A (en) * 2019-04-23 2019-07-30 东华大学 A kind of non-relational database dynamic hybrid index method
CN110572464A (en) * 2019-09-12 2019-12-13 北京浪潮数据技术有限公司 Bottom layer resource state synchronization method and device, cloud platform system and storage medium
CN110750497A (en) * 2019-10-29 2020-02-04 山东易华录信息技术有限公司 Data scheduling system
CN111414403A (en) * 2020-03-20 2020-07-14 腾讯科技(深圳)有限公司 Data access method and device and data storage method and device
CN111610989A (en) * 2020-06-17 2020-09-01 中国人民解放军国防科技大学 Application release/update method and system for offline container cloud environment
CN111708795A (en) * 2020-06-22 2020-09-25 中国平安财产保险股份有限公司 Object identification generation method, object identification updating device, computer equipment and medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Adaptive Clustering-Based Change Prediction for Refreshing Web Repository;Manaskasemsak, B 等;《COMPUTATIONAL SCIENCE AND ITS APPLICATIONS》;第9155卷;516-528 *
SCALOP: sequence-based antibody canonical loop structure annotation;Wong, WK等;《BIOINFORMATICS》;20190515;第35卷(第10期);1774-1776 *
云环境下大规模分布式计算数据感知的调度系统;刘汪根等;《大数据》;第6卷(第1期);81-98 *
数据流计算环境下的集群资源管理技术;汤小春等;《大数据》;20200223;第6卷(第3期);87-100 *

Also Published As

Publication number Publication date
CN112818059A (en) 2021-05-18

Similar Documents

Publication Publication Date Title
US9779128B2 (en) System and method for massively parallel processing database
EP2653986B1 (en) Client-side caching of a database transaction token.
US10726042B2 (en) Replication control using eventually consistent meta-data
CN111143382B (en) Data processing method, system and computer readable storage medium
CN108140035B (en) Database replication method and device for distributed system
US8301750B2 (en) Apparatus, system, and method for facilitating communication between an enterprise information system and a client
CN113438275B (en) Data migration method and device, storage medium and data migration equipment
CN112818059B (en) Information real-time synchronization method and device based on container release platform
US11915035B1 (en) Task state updating method and apparatus, device, and medium
CN111208949B (en) Method for determining data rollback time period in distributed storage system
CN116821232A (en) Data synchronization method and related device
CN114547206A (en) Data synchronization method and data synchronization system
CN110659299B (en) Data updating method and device and front-end development client
CN111399753B (en) Method and device for writing pictures
US8838910B2 (en) Multi-part aggregated variable in structured external storage
CN113783921A (en) Method and device for creating cache component
CN113032477A (en) Long-distance data synchronization method and device based on GTID and computing equipment
CN112968792B (en) Method and device for controlling upgrading of equipment of Internet of things
CN112055057B (en) Method, system and equipment for dynamic expansion of Web system
WO2023124431A1 (en) Database processing method and related device
KR101929948B1 (en) Method and system for data type based multi-device synchronization
CN117149902A (en) Data processing method and device, electronic equipment and storage medium
CN115391390A (en) Method and device for providing time-consuming information of Redis cluster
CN116383002A (en) Data acquisition system and method
CN114138746A (en) Database monitoring method, device, equipment and storage 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