Service method of a dns system and server in a dns system

By adopting an asynchronous deployment architecture for the front-end and back-end components of the DNS system, the problems of slow user access speed and high request pressure in the DNS system are solved, achieving faster access speed and ensuring the uniqueness and order of operations.

CN116708364BActive Publication Date: 2026-04-21SINA TECH (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SINA TECH (CHINA) CO LTD
Filing Date
2023-05-16
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In existing technologies, DNS system servers suffer from slow user access speeds and high request pressure when processing domain name assignment operations, especially when public resources are loaded multiple times.

Method used

An asynchronous deployment architecture is adopted for front-end and back-end components. The front-end component receives the request and sends it to the asynchronously deployed back-end component. The back-end component acquires the distributed lock and executes the specified operation, and the distributed lock ensures the order and uniqueness of the operation.

Benefits of technology

This reduces the frequency of the server receiving and responding to domain-specific operation requests, reduces server request pressure, improves user access speed, and ensures the uniqueness and order of operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116708364B_ABST
    Figure CN116708364B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a DNS system service method and a server in a DNS system, and relates to the field of application services.The method comprises the following steps: a front-end component on the server side receives a request for specifying operation on a domain name sent by a user, and sends the request for specifying operation on the domain name to a back-end component on the server side which is asynchronously deployed with the front-end component; wherein the operation comprises adding a domain name, modifying a domain name or deleting a domain name; after the back-end component receives the request for specifying operation on the domain name, the back-end component acquires a distributed lock corresponding to the domain name; in the case of acquiring the distributed lock corresponding to the domain name, the back-end component executes the specified operation on the domain name in response to the request for specifying operation on the domain name. One distributed lock corresponding to one domain name is set, so that only the user holding the distributed lock can perform the specified operation on the domain name at the same time, and the order and uniqueness of the operation can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of application services, and more specifically to a service method for a DNS system and a server in a DNS system. Background Technology

[0002] In existing technologies, in systems that allow specifying operations on domain names, the server's reception of requests for specifying operations on domain names and the execution of those operations are integrated into a single structure. In other words, the service backend uses a unified architecture that is not separated, resulting in high coupling.

[0003] During the implementation of this invention, the applicant discovered that:

[0004] When the service backend uses a unified architecture without separation, it will result in slow access speed for users. When common resources within the server are loaded multiple times, the server will experience excessive request pressure. Summary of the Invention

[0005] This invention provides a service method for a DNS system and a server in the DNS system, which can solve the technical problems in the prior art where users experience slow access speeds when the server performs specified operations on a domain name, and where the server experiences excessive request pressure when public resources are loaded multiple times.

[0006] To achieve the above objectives, in one aspect, embodiments of the present invention provide a service method for a DNS system, including:

[0007] The front-end component on the server side receives a request from the user to perform a specified operation on the domain name, and sends the request to a back-end component on the server side that is asynchronously deployed with the front-end component; wherein, the operation includes: adding a domain name, modifying a domain name, or deleting a domain name;

[0008] After receiving the request to perform a specified operation on the domain name, the backend component acquires the distributed lock corresponding to the domain name;

[0009] If a distributed lock corresponding to the domain name is acquired, the backend component responds to the request to perform a specified operation on the domain name and executes the specified operation on the domain name.

[0010] On the other hand, embodiments of the present invention provide a server in a DNS system, including asynchronously deployed front-end components and back-end components, wherein:

[0011] The front-end component is used to receive a user's request to perform a specified operation on a domain name, and send the request to perform the specified operation on the domain name to the back-end component; wherein, the operation includes: adding a domain name, modifying a domain name, or deleting a domain name;

[0012] The backend component is configured to, upon receiving the request to perform a specified operation on the domain name, acquire a distributed lock corresponding to the domain name; and, upon acquiring the distributed lock corresponding to the domain name, execute the specified operation on the domain name in response to the request to perform a specified operation on the domain name.

[0013] The above technical solution has the following beneficial effects: The server is equipped with a front-end component and a back-end component. The front-end component receives requests for specific operations on a domain name, while the back-end component responds to requests and executes the specified operations on the domain name. This separated structure reduces the frequency with which the server receives user requests, responds to requests for specific operations on a domain name, and records data, avoiding data loading that puts pressure on the server and indirectly improving user access speed. Setting a corresponding distributed lock for each domain name ensures that only users holding the distributed lock can perform specified operations on the same domain name at the same time, guaranteeing the order and uniqueness of the operations. Attached Figure Description

[0014] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0015] Figure 1 This is a flowchart of a service method for a DNS system according to an embodiment of the present invention;

[0016] Figure 2 This is a server structure diagram in a DNS system according to an embodiment of the present invention;

[0017] Figure 3 This is a server architecture diagram in another DNS system according to an embodiment of the present invention;

[0018] Figure 4 This is a flowchart of the asynchronous server architecture of an embodiment of the present invention;

[0019] Figure 5 This is a logical flowchart of the asynchronous service of the DNS system according to an embodiment of the present invention;

[0020] Figure 6 This is a flowchart of the distributed lock implementation in an embodiment of the present invention. Detailed Implementation

[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0022] ETCD is an open-source, distributed key-value data storage system.

[0023] MySQL is an open-source relational database management system.

[0024] React is a JavaScript library for dynamically building user interfaces, focusing solely on the view. It originated as an internal Facebook project; the company was dissatisfied with all existing JavaScript MVC frameworks on the market and decided to develop its own to power the Instagram website.

[0025] CMDB, or Configuration Management Database, is a logical database that contains information about the entire lifecycle of configuration items and the relationships between them (including physical relationships, real-time communication relationships, non-real-time communication relationships, and dependencies).

[0026] Antd is a React UI component library based on the Ant Design framework, primarily used for developing enterprise-level middle and back-end products.

[0027] like Figure 1 As shown, in conjunction with embodiments of the present invention, a service method for a DNS system is provided, comprising:

[0028] S101: The front-end component on the server side receives a request from a user to perform a specified operation on a domain name, and sends the request to a back-end component on the server side that is asynchronously deployed with the front-end component; wherein, the operation includes: adding a domain name, modifying a domain name, or deleting a domain name; the server has a front-end component and a back-end component, the front-end component receives the request to perform a specified operation on a domain name, and the back-end component is used to respond to the request and execute the specified operation on the domain name in the request; the separate composition structure reduces the frequency of the entire server receiving user requests, responding to requests to perform specified operations on domain names, and recording data, avoiding the request pressure on the server caused by loading data, and indirectly improving the user's access speed.

[0029] S102: After receiving the request to perform a specified operation on the domain name, the backend component acquires the distributed lock corresponding to the domain name; sets a corresponding distributed lock for a domain name to ensure that only the request to perform a specified operation on the domain name corresponding to the user holding the distributed lock is executed at the same time, thus ensuring the order and uniqueness of the operation.

[0030] S103: If a distributed lock corresponding to the domain name is acquired, the backend component responds to the request to perform a specified operation on the domain name and executes the specified operation on the domain name.

[0031] Preferably, S102: Obtaining the distributed lock corresponding to the domain name specifically includes:

[0032] S1021: Initiate a lock request for the domain name to the lock application within the backend component. The lock request is used to obtain a corresponding distributed lock for the domain name.

[0033] S1022: The lock application sets a first lease time for the lock request and listens for the distributed lock located in the database during the first lease time;

[0034] S1023: Upon initial listening and finding that the distributed lock corresponding to the domain name is in an idle state, a transaction is created, and a unique lock value is assigned to the key of the key-value pair representing the distributed lock through the created transaction;

[0035] S1024: Upon initial listening and detection that the distributed lock corresponding to the domain name is in use, further listen to whether the distributed lock corresponding to the domain name is released within the first lease period. If so, create a transaction and assign a unique lock value to the key of the key-value pair representing the distributed lock through the created transaction.

[0036] S1025: If, during the first lease period, a unique lock value is successfully assigned to the key of the key-value pair representing the distributed lock, the distributed lock is bound to a second lease period, and the value of the key-value pair representing the distributed lock is set to the domain name, forming a key-value pair for representing the distributed lock;

[0037] S1026: If, during the first lease period, it fails to assign a unique lock value to the key of the key-value pair representing the distributed lock, send information about the distributed lock acquisition error to the backend component.

[0038] Because business requirements necessitate ensuring the sequentiality and uniqueness of domain name operations, when multiple users need to operate on the same domain, a subsequent user can only operate after the previous user has completed their operation. Therefore, during the process of acquiring the distributed lock, if one user fails to acquire it, an error will be reported directly after the first lease expires. Preferably, the service method of the DNS system further includes:

[0039] If an exception occurs in the backend component during the execution of the specified operation on the domain name in response to the request of the backend component, the lock application automatically deletes the distributed lock after the second lease expires, thus avoiding deadlock.

[0040] Preferably, the asynchronous deployment of the front-end component and the back-end component means that the front-end component is used to receive requests and the parameter data carried in the requests, while the back-end component is used to provide the response data corresponding to the requests. The server uses a separate deployment of front-end and back-end components, thus processing user requests and responses separately. This results in faster user access speeds, improved page performance for both front-end and back-end components, optimized user experience, no page jumps, resources all within the same page without the need for separate data loading, and faster switching between page segments, significantly enhancing the user experience. Furthermore, the separate deployment of front-end and back-end components, each with its own rendering mode, avoids triggering browser reflow and repaint for every request and response, further accelerating user access. This also reduces server request pressure, as common resources only need to be loaded once, reducing the number of HTTP requests.

[0041] Preferably, the service method of the DNS system further includes:

[0042] S104: Before the backend component acquires the distributed lock corresponding to the domain name, determine whether the user has permission to operate on the domain name. If the user has permission to operate on the domain name, execute the operation of acquiring the distributed lock corresponding to the domain name; otherwise, reject the request to perform the specified operation on the domain name, ensuring that only users with permission to operate on the domain name can operate on the domain name.

[0043] like Figure 2 As shown, in conjunction with an embodiment of the present invention, a server in a DNS system is provided, including an asynchronously deployed front-end component 21 and a back-end component 22, wherein:

[0044] The front-end component 21 is used to receive a user's request to perform a specified operation on a domain name and send the request to the back-end component. The operation includes adding a domain name, modifying a domain name, or deleting a domain name. The server has a front-end component and a back-end component. The front-end component receives the request to perform a specified operation on a domain name, and the back-end component responds to the request and executes the specified operation on the domain name. The separate structure reduces the frequency of the server receiving user requests and responding to requests to perform specified operations on domain names, avoiding the request pressure on the server caused by loading data, and indirectly improving the user's access speed.

[0045] The backend component 22 is configured to, upon receiving the request to perform a specified operation on the domain name, acquire a distributed lock corresponding to the domain name; and, upon acquiring the distributed lock, execute the specified operation on the domain name in response to the request. Setting a corresponding distributed lock for each domain name ensures that only requests from users holding the distributed lock are executed at any given time, guaranteeing the order and uniqueness of the operations.

[0046] Preferably, the backend component 22 includes a lock request unit, a lock application, a listening unit, a transaction unit, and an error reporting unit, wherein:

[0047] The lock request unit is used to initiate a lock request for the domain name to the lock application, and the lock request is used to obtain the corresponding distributed lock for the domain name;

[0048] The lock application is used to set a first lease time for the lock request;

[0049] The monitoring unit is used to monitor the distributed lock located in the database during the first lease period;

[0050] The transaction unit is configured to, upon initial listening and upon detecting that the distributed lock corresponding to the domain name is in an idle state, create a transaction and assign a unique lock value to the key of the key-value pair representing the distributed lock through the created transaction; and, upon initial listening and upon detecting that the distributed lock corresponding to the domain name is in a used state, further monitor whether the distributed lock corresponding to the domain name is released within the first lease period; if so, create a transaction and assign a unique lock value to the key of the key-value pair representing the distributed lock through the created transaction.

[0051] The lock application is also used to bind a second lease time to the distributed lock if, during the first lease period, a unique lock value is successfully assigned to the key of the key-value pair representing the distributed lock.

[0052] The transaction unit is configured to, within the first lease period, if it is successful in assigning a unique lock value to the key of the key-value pair representing the distributed lock, set the value of the key-value pair representing the distributed lock to the domain name, thereby forming a key-value pair representing the distributed lock.

[0053] The error reporting unit is used to send information about the distributed lock acquisition error to the backend component if it fails to assign a unique lock value to the key of the key-value pair representing the distributed lock within the first lease period.

[0054] Because the business requires ensuring the sequentiality and uniqueness of domain name operations, when multiple users need to operate on the same domain, a subsequent user can only operate after the previous user has finished. Therefore, during the process of acquiring the distributed lock, if one user fails to acquire it, an error will be reported directly after the first lease expires.

[0055] Preferably, the lock application is further used for:

[0056] In the event of an exception occurring in the backend component during the execution of the specified operation on the domain name in response to the request, the distributed lock is automatically deleted after the second lease expires, thus avoiding deadlock.

[0057] Preferably, the asynchronous deployment of the front-end component and the back-end component means that the front-end component is used to receive requests and the parameter data carried in the requests, while the back-end component is used to provide the response data corresponding to the requests. The server uses a separate deployment of front-end and back-end components, thus processing user requests and responses separately. This results in faster user access speeds, improved page performance for both front-end and back-end components, optimized user experience, no page jumps, resources all within the same page without the need for separate data loading, and faster switching between page segments, significantly enhancing the user experience. Furthermore, the separate deployment of front-end and back-end components, each with its own rendering mode, avoids triggering browser reflow and repaint for every request and response, further accelerating user access. This also reduces server request pressure, as common resources only need to be loaded once, reducing the number of HTTP requests.

[0058] Preferably, the back-end group 22 further includes:

[0059] The permission determination unit is used to determine whether the user has permission to operate on the domain name before acquiring the distributed lock corresponding to the domain name. If the user has permission to operate on the domain name, the operation of acquiring the distributed lock corresponding to the domain name is executed; otherwise, the request to perform the specified operation on the domain name is rejected, ensuring that only users with permission to operate on the domain name can operate on the domain name.

[0060] The technical solutions of the present invention will be described in detail below with reference to specific application examples. For technical details not described in the implementation process, please refer to the relevant descriptions above.

[0061] This invention provides a service method for a DNS system and a server within that system. The server architecture diagram is shown below. Figure 3 As shown, the architecture is described as follows: (1) The overall structure includes: UI layer, business layer, storage layer, and middleware; (2) Access control covers the first two layers; (3) MySQL is used as the storage layer, and ETCD is used as the middleware to communicate with downstream services. Applied to DNS systems, such as DNS systems based on ETCD and MySQL, the asynchronous architecture design of the front-end component and the back-end component means that the front-end component and the back-end component are deployed separately, and the front-end component and the back-end component have their own rendering modes, which will not trigger the browser reflow and repaint of the front-end component. The front-end component has an agent service, and the back-end component has an agent service. The agent service of the front-end component and the agent service of the back-end component are decoupled, so that when one service has a problem, it will not affect the other.

[0062] like Figure 4 The diagram shows the asynchronous server architecture workflow in the DNS system, and the logical flow diagram of the asynchronous service in the DNS system is as follows. Figure 5 As shown; the workflow of the DNS system service method of this embodiment includes the following steps:

[0063] 1. Users can access the service by entering the backend component through the frontend component. The frontend component on the server side receives a request from the user to perform a specified operation on the domain name, and sends the request to the backend component on the server side, which is deployed asynchronously with the frontend component; wherein, the operation includes: adding a domain name, modifying a domain name, or deleting a domain name.

[0064] Second, upon entering the service, the system first performs access control to determine the user's permissions. It checks whether the user has permission to operate on the domain name. If the user has the permission, the operation of acquiring the distributed lock corresponding to the domain name is executed; otherwise, the request to perform the specified operation on the domain name is rejected. For example, if the current user requests to perform a specified operation on a business attribute, such as adding a domain name, but the user does not have permission to add a domain name, the user will be informed that they do not have this permission.

[0065] Furthermore, user actions are recorded in the database, and the data after user actions is organized and written into ETCD; the entire process is recorded through logs.

[0066] Third, the backend component, based on the user's permissions, can respond to user requests to perform specified operations on a domain name, first processing each user request into a corresponding structure. After processing, the data is written to ETCD, and a distributed lock corresponding to the domain name is obtained from the lock application within the backend component. If a distributed lock corresponding to the domain name is obtained, the backend component responds to the request to perform the specified operation on the domain name, and sequentially writes the requested data to the MySQL storage and the ETCD middleware.

[0067] If a distributed lock corresponding to the domain name is not acquired, a waiting time (the first lease time) will be set for this request. If the waiting time expires and the distributed lock is still not acquired, an exception will be thrown and the request will return. The purpose of using distributed locks is to ensure that only one user / request is operating on the same domain name at any given time, preventing multiple operators with domain name operation permissions from operating on the same domain name and causing data conflicts and exceptions.

[0068] The agent services of the front-end component and the agent services of the back-end component communicate through the middleware ETCD to achieve decoupling, so that when one service has a problem, it will not affect the other.

[0069] like Figure 6 The diagram shows a flowchart of a user requesting to acquire a distributed lock.

[0070] 1. Initiate a lock request for the domain name to the lock application (i.e., a client) within the backend component. The lock request is used to acquire the corresponding distributed lock for the domain name.

[0071] 2. The lock application instantiates a lease object, that is, initializes a Lease class and sets the first lease time, which is calculated from the time the user acquires the distributed lock corresponding to the domain name.

[0072] 3. The lock application sets a first lease time for the lock request and listens for the distributed lock located in the database during the first lease time.

[0073] Acquiring a distributed lock is a cyclical process. Before saving the data corresponding to a user's request to perform a specified operation on a domain name to MySQL, a distributed lock needs to be acquired. This acquisition occurs within the first lease period. Utilizing ETCD's watch mechanism, changes to the distributed lock (key) in ETCD are monitored periodically. When a change is detected, a transaction is immediately created to acquire the lock.

[0074] 4. Create a transaction

[0075] Upon initial listening and finding that the distributed lock corresponding to the domain name is in an idle state, a transaction is created, and a unique lock value is assigned to the key of the key-value pair representing the distributed lock through the created transaction;

[0076] If, during the first listening, it is found that the distributed lock corresponding to the domain name is in use, further listening is conducted to see if the distributed lock corresponding to the domain name is released within the first lease period. If so, a transaction is created, and a unique lock value is assigned to the key of the key-value pair representing the distributed lock through the created transaction.

[0077] If, during the first lease period, a unique lock value is successfully assigned to the key of the key-value pair representing the distributed lock, a second lease period is bound to the distributed lock, and the value of the key-value pair representing the distributed lock is set to the domain name, forming a key-value pair for representing the distributed lock; if, during the first lease period, a unique lock value is not assigned to the key of the key-value pair representing the distributed lock, information indicating an exception in obtaining the distributed lock is sent to the backend component.

[0078] In other words, when acquiring a distributed lock, if the distributed lock corresponding to the domain name is detected to be in use, an attempt is made to acquire the lock through a transaction (assigning a unique lock value to the current key). It checks if the current key has already been created. If so, a second lease is bound and the key and value information are updated, indicating successful lock acquisition. Otherwise, information about a currently created key is retrieved. Based on the domain name recorded in the key, it's determined whether a user is operating on that domain. If so, it means that the domain is currently displayed in the key, indicating that the domain has already been locked, thus confirming that the lock acquisition failed.

[0079] Because the business requires ensuring the order and uniqueness of domain name operations, during the process of acquiring the distributed lock, if one user fails to acquire the domain, an error will be displayed after the first lease expires, stating: "Another user is currently operating on this domain." In other words, when multiple users need to operate on the same domain, a subsequent user can only proceed after the previous user has finished their operation.

[0080] The distributed lock is stored in ETCD using a key format: " / lock / " as the prefix and "name" as the suffix. Each user has a unique UUID value corresponding to the key. The name represents the business domain name address (domain_id) and the lease time (TTL) (used to set the lease duration). An example key is: / lock / 1. Distributed lock usage includes: acquire the lock, release the lock, refresh the lock, and check if the lock has been acquired ("is_acquired").

[0081] 4. During the lease period, the system will attempt to acquire the lock in a loop. If the lock is acquired, the business logic will be executed: in response to the request to perform a specified operation on the domain name, the specified operation on the domain name will be executed.

[0082] 5. If an exception occurs in the backend component during the execution of the specified operation on the domain name in response to the request, the lock application will automatically delete the distributed lock after the second lease expires. Specifically, the lease mechanism is an inherent mechanism of ETCD, providing a keep-alive operation for the distributed lock. A lease is bound when the distributed lock is created and renewed periodically. If the lock application crashes unexpectedly during the lock acquisition period, the held distributed lock will be automatically deleted upon expiration, avoiding deadlock.

[0083] Fourth, record the specified operations performed by the user on the domain name (similar to log data) in the MySQL database.

[0084] 5. After the user's operation data is organized into log-like data, it is written to ETCD. After being written to ETCD, the operation record will be stored in MySQL, and the status (success / failure) will be returned to the user.

[0085] VI. The entire process will be recorded in a log.

[0086] The beneficial effects achieved by the embodiments of the present invention are as follows:

[0087] 1. By deploying the server with separate front-end and back-end components, user requests and responses are processed separately. This results in faster access speeds, improved page performance for both front-end and back-end components, and an optimized user experience. There are no page jumps, resources are all on the same page, eliminating the need for separate data loading, and page transitions are faster, significantly enhancing the user experience. Furthermore, the separate deployment of front-end and back-end components, each with its own rendering mode, prevents the browser from reflowing and repainting for every request and response, further accelerating access speeds. This also reduces server request pressure, as shared resources only need to be loaded once, reducing the number of HTTP requests.

[0088] 2. By adopting ETCD distributed deployment, the concurrency is increased, preventing the DNS system from being unable to provide services after a single node goes down. For the same business, ETCD is used as a distributed lock to ensure that there is only one operation on the data at a single moment. When multiple users request the same data at the same time, sequential processing is performed to prevent data corruption when operating on the same domain name.

[0089] 3. The system adopts ETCD distributed deployment, which supports more flexible permissions. By controlling the operation types of various resources, users can have richer permissions. In other words, through ETCD storage locks, fine-grained control of user permissions can be achieved to avoid the impact of data conflicts. In addition, no new component services have been introduced, making the system architecture simpler and more efficient.

[0090] It should be understood that the specific order or hierarchy of steps in the disclosed process is an example of an exemplary method. Based on design preferences, it should be understood that the specific order or hierarchy of steps in the process may be rearranged without departing from the scope of this disclosure. The appended method claims provide elements of various steps in an exemplary order and are not intended to limit the specific order or hierarchy described.

[0091] In the above detailed description, various features are combined together in a single embodiment to simplify this disclosure. This approach to disclosure should not be construed as reflecting an intention that embodiments of the claimed subject matter require more features than are explicitly stated in each claim. Rather, as reflected in the appended claims, the invention is presented with fewer features than all of the features of the single disclosed embodiment. Therefore, the appended claims are hereby explicitly incorporated into the detailed description, wherein each claim stands alone as a preferred embodiment of the invention.

[0092] The disclosed embodiments have been described above to enable any person skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be applied to other embodiments without departing from the spirit and scope of this disclosure. Therefore, this disclosure is not limited to the embodiments given herein, but is consistent with the broadest scope of the principles and novel features disclosed in this application.

[0093] The foregoing description includes examples of one or more embodiments. It is certainly impossible to describe all possible combinations of components or methods in order to describe the above embodiments, but those skilled in the art will recognize that further combinations and arrangements of the various embodiments are possible. Therefore, the embodiments described herein are intended to cover all such changes, modifications, and variations that fall within the scope of the appended claims. Furthermore, the term "comprising" as used in the specification or claims is interpreted in a manner similar to the term "including," as interpreted when used as a conjunction in the claims. Additionally, the use of any term "or" in the specification of the claims is intended to mean "non-exclusive or."

[0094] Those skilled in the art will also understand that the various illustrative logical blocks, units, and steps listed in the embodiments of the present invention can be implemented by electronic hardware, computer software, or a combination of both. To clearly demonstrate the interchangeability of hardware and software, the functions of the various illustrative components, units, and steps described above have been generally described. Whether such functionality is implemented through hardware or software depends on the specific application and the overall system design requirements. Those skilled in the art can implement the described functions using various methods for each specific application, but such implementation should not be construed as exceeding the scope of protection of the embodiments of the present invention.

[0095] The various illustrative logic blocks or units described in the embodiments of this invention can be implemented or operate the described functions using a general-purpose processor, digital signal processor, application-specific integrated circuit (ASIC), field-programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof. The general-purpose processor can be a microprocessor; alternatively, it can be any conventional processor, controller, microcontroller, or state machine. The processor can also be implemented using a combination of computing devices, such as a digital signal processor and a microprocessor, multiple microprocessors, one or more microprocessors combined with a digital signal processor core, or any other similar configuration.

[0096] The steps of the methods or algorithms described in the embodiments of this invention can be directly embedded in hardware, a software module executed by a processor, or a combination of both. The software module can be stored in RAM, flash memory, ROM, EPROM, EEPROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium in the art. Exemplarily, the storage medium can be connected to the processor so that the processor can read information from and write information to the storage medium. Optionally, the storage medium can also be integrated into the processor. The processor and storage medium can be housed in an ASIC, which can be housed in a user terminal. Optionally, the processor and storage medium can also be housed in different components of the user terminal.

[0097] In one or more exemplary designs, the functions described in the embodiments of the present invention can be implemented in hardware, software, firmware, or any combination of these three. If implemented in software, these functions can be stored on a computer-readable medium or transmitted on a computer-readable medium in the form of one or more instructions or code. Computer-readable media include computer storage media and communication media that facilitate the transfer of computer programs from one place to another. Storage media can be any available media that can be accessed by a general-purpose or special-purpose computer. For example, such computer-readable media can include, but is not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store program code in the form of instructions or data structures and other forms that can be read by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Furthermore, any connection can be suitably defined as a computer-readable medium, for example, if the software is transmitted from a website, server or other remote resource via a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wirelessly, such as infrared, wireless and microwave, it is also included in the defined computer-readable medium. The disks and discs mentioned include compressed disks, laser discs, optical discs, DVDs, floppy disks, and Blu-ray discs. Disks typically copy data magnetically, while disks typically copy data optically using lasers. Combinations of the above can also be contained in computer-readable media.

[0098] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A service method of a DNS system, characterized by, include: The front-end component on the server side receives a request from the user to perform a specified operation on the domain name, and sends the request to a back-end component on the server side that is asynchronously deployed with the front-end component; wherein, the operation includes: adding a domain name, modifying a domain name, or deleting a domain name; After receiving the request to perform a specified operation on the domain name, the backend component acquires the distributed lock corresponding to the domain name; If a distributed lock corresponding to the domain name is acquired, the backend component responds to the request to perform a specified operation on the domain name and executes the specified operation on the domain name. The acquisition of the distributed lock corresponding to the domain name specifically includes: A lock request is initiated for the domain name to the lock application within the backend component, and the lock request is used to obtain the corresponding distributed lock for the domain name. The lock application sets a first lease time for the lock request and listens for distributed locks located in the database during the first lease time; Upon initial listening and finding that the distributed lock corresponding to the domain name is in an idle state, a transaction is created, and a unique lock value is assigned to the key of the key-value pair representing the distributed lock through the created transaction; If, upon initial monitoring and confirmation that the distributed lock corresponding to the domain name is in use, the system further monitors whether the distributed lock corresponding to the domain name is released within the first lease period. If so, a transaction is created, and a unique lock value is assigned to the key of the key-value pair representing the distributed lock through the created transaction. If the unique lock value is successfully assigned to the key of the key-value pair representing the distributed lock within the first lease period, a second lease period is bound to the distributed lock, and the value of the key-value pair representing the distributed lock is set to the domain name, forming a key-value pair used to represent the distributed lock. If, during the first lease period, it fails to assign a unique lock value to the key of the key-value pair representing the distributed lock, a message indicating an exception in acquiring the distributed lock is sent to the backend component.

2. The service method of the DNS system according to claim 1, characterized by, Also includes: If an exception occurs in the backend component during the execution of the specified operation on the domain name in response to the request of the backend component, the lock application will automatically delete the distributed lock after the second lease expires.

3. The service method of the DNS system according to claim 1, characterized by, The asynchronous deployment of the front-end component and the back-end component means that the front-end component is used to receive requests and the parameter data carried in the requests, while the back-end component is used to provide the response data corresponding to the requests.

4. The service method of the DNS system according to claim 1, characterized by, Also includes: Before the backend component acquires the distributed lock corresponding to the domain name, it determines whether the user has permission to operate on the domain name. If the user has permission to operate on the domain name, the operation of acquiring the distributed lock corresponding to the domain name is executed; otherwise, the request to perform the specified operation on the domain name is rejected.

5. A server in a DNS system, c h a r a c t e r i z e d b y, This includes asynchronously deployed front-end and back-end components, among which: The front-end component is used to receive a user's request to perform a specified operation on a domain name, and send the request to perform the specified operation on the domain name to the back-end component; wherein, the operation includes: adding a domain name, modifying a domain name, or deleting a domain name; The backend component is configured to, upon receiving the request to perform a specified operation on the domain name, acquire a distributed lock corresponding to the domain name; and, upon acquiring the distributed lock corresponding to the domain name, execute the specified operation on the domain name in response to the request to perform a specified operation on the domain name. The backend components include a lock request unit, a lock application, a listening unit, a transaction unit, and an error reporting unit, wherein: The lock request unit is used to initiate a lock request for the domain name to the lock application on a per-domain basis. The lock request is used to obtain the corresponding distributed lock for the domain name. The lock application is used to set a first lease time for the lock request; The monitoring unit is used to monitor the distributed lock located in the database during the first lease period; The transaction unit is configured to, upon initial listening and upon detecting that the distributed lock corresponding to the domain name is in an idle state, create a transaction and assign a unique lock value to the key of the key-value pair representing the distributed lock through the created transaction; and, upon initial listening and upon detecting that the distributed lock corresponding to the domain name is in a used state, further monitor whether the distributed lock corresponding to the domain name is released within the first lease period; if so, create a transaction and assign a unique lock value to the key of the key-value pair representing the distributed lock through the created transaction. The lock application is also used to bind a second lease time to the distributed lock if, during the first lease period, a unique lock value is successfully assigned to the key of the key-value pair representing the distributed lock. The transaction unit is configured to, within the first lease period, if it is successful in assigning a unique lock value to the key of the key-value pair representing the distributed lock, set the value of the key-value pair representing the distributed lock to the domain name, thereby forming a key-value pair representing the distributed lock. The error reporting unit is used to send information about the distributed lock acquisition error to the backend component if it fails to assign a unique lock value to the key of the key-value pair representing the distributed lock within the first lease period.

6. A server in a DNS system according to claim 5, characterized in that, The lock application is also used for: If an exception occurs in the backend component during the execution of the specified operation on the domain name in response to the request, the distributed lock will be automatically deleted after the second lease expires.

7. The server in a DNS system of claim 5, wherein, The asynchronous deployment of the front-end component and the back-end component means that the front-end component is used to receive requests and the parameter data carried in the requests, while the back-end component is used to provide the response data corresponding to the requests.

8. The server in a DNS system of claim 5, wherein, The backend components also include: The permission judging unit is configured to judge whether the user has the permission to operate the domain name before acquiring the distributed lock corresponding to the domain name, and execute the operation of acquiring the distributed lock corresponding to the domain name if the user has the permission to operate the domain name; otherwise, reject the request of performing the specified operation on the domain name.

Citation Information

Patent Citations

  • Data management system, method and equipment

    CN114741067A

  • Distributed lock control method and device based on database, equipment and medium

    CN115982184A