CN116455594A - Distributed intelligent lighting system, access method and related device - Google Patents

Distributed intelligent lighting system, access method and related device Download PDF

Info

Publication number
CN116455594A
CN116455594A CN202310090639.2A CN202310090639A CN116455594A CN 116455594 A CN116455594 A CN 116455594A CN 202310090639 A CN202310090639 A CN 202310090639A CN 116455594 A CN116455594 A CN 116455594A
Authority
CN
China
Prior art keywords
request
verification value
resource server
target
memory
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.)
Pending
Application number
CN202310090639.2A
Other languages
Chinese (zh)
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.)
Shenzhen Haiyangwang Petroleum Lighting Technology Co ltd
Shenzhen Haiyangwang Power Grid Lighting Technology Co ltd
Shenzhen Haiyangwang Railway Lighting Technology Co ltd
Shenzhen Ocean King Green Lighting Technology Co ltd
Shenzhen Ocean King Metallurgical Lighting Technology Co ltd
Shenzhen Ocean King Petrochemical Lighting Technology Co ltd
Shenzhen Ocean King Ship Venue Lighting Technology Co ltd
Shenzhen Ocean Wanggongxiao Lighting Technology Co ltd
Oceans King Lighting Science and Technology Co Ltd
Oceans King Dongguan Lighting Technology Co Ltd
Shenzhen Oceans King Lighting Engineering Co Ltd
Original Assignee
Shenzhen Haiyangwang Petroleum Lighting Technology Co ltd
Shenzhen Haiyangwang Power Grid Lighting Technology Co ltd
Shenzhen Haiyangwang Railway Lighting Technology Co ltd
Shenzhen Ocean King Green Lighting Technology Co ltd
Shenzhen Ocean King Metallurgical Lighting Technology Co ltd
Shenzhen Ocean King Petrochemical Lighting Technology Co ltd
Shenzhen Ocean King Ship Venue Lighting Technology Co ltd
Shenzhen Ocean Wanggongxiao Lighting Technology Co ltd
Oceans King Lighting Science and Technology Co Ltd
Oceans King Dongguan Lighting Technology Co Ltd
Shenzhen Oceans King Lighting Engineering Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Haiyangwang Petroleum Lighting Technology Co ltd, Shenzhen Haiyangwang Power Grid Lighting Technology Co ltd, Shenzhen Haiyangwang Railway Lighting Technology Co ltd, Shenzhen Ocean King Green Lighting Technology Co ltd, Shenzhen Ocean King Metallurgical Lighting Technology Co ltd, Shenzhen Ocean King Petrochemical Lighting Technology Co ltd, Shenzhen Ocean King Ship Venue Lighting Technology Co ltd, Shenzhen Ocean Wanggongxiao Lighting Technology Co ltd, Oceans King Lighting Science and Technology Co Ltd, Oceans King Dongguan Lighting Technology Co Ltd, Shenzhen Oceans King Lighting Engineering Co Ltd filed Critical Shenzhen Haiyangwang Petroleum Lighting Technology Co ltd
Priority to CN202310090639.2A priority Critical patent/CN116455594A/en
Publication of CN116455594A publication Critical patent/CN116455594A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0815Network architectures or network communication protocols for network security for authentication of entities providing single-sign-on or federations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B20/00Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
    • Y02B20/40Control techniques providing energy savings, e.g. smart controller or presence detection

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Selective Calling Equipment (AREA)

Abstract

The embodiment of the invention discloses a distributed intelligent lighting system, an access method and a related device, wherein the distributed intelligent lighting system comprises a front end, a nginx, a gateway service, a micro service, a database, a gateway centralized module and terminal equipment.

Description

Distributed intelligent lighting system, access method and related device
Technical Field
The invention relates to the technical field of computer software application, in particular to a distributed intelligent lighting system, an access method and a related device.
Background
The existing intelligent working lighting system adopts a single service and adopts an architecture mode of coupling all functions and modules in one application; one server is used to run all functions. Under the condition that the number of gateways and devices which are accessed into the system is large, the number of single services to the processing devices is limited, meanwhile, the service expansibility is poor, and when the service is down, the system can not be used. When using a distributed framework, a large application is split into multiple small applications (micro-services) that are relatively independent. When the number of the devices is larger than the number of the service processes, the capacity of improving the number of the processing devices can be achieved by adding corresponding services through the newly added servers. If one service is down, other services can normally run without affecting the normal use of the system.
However, since the distributed intelligent lighting system has a plurality of servers, how to efficiently implement the front-end quick access when the front-end makes an access request is a problem to be solved.
Disclosure of Invention
The invention mainly aims to provide a distributed intelligent lighting system, an access method and a related device, wherein the related device comprises an access device, computer equipment and a storage medium, and can solve the problem of low front-end access speed in the prior art.
To achieve the above object, a first aspect of the present invention provides a distributed intelligent lighting system, which includes a front end, a nginx, a gateway service, a micro service, a database, a gateway centralized module, and a terminal device;
the front end is used for initiating a request;
the nginx is used for selecting server jump according to a request path of a request and the number of servers deployed by the distributed intelligent lighting system;
the gateway service is used for appointing authentication service in the micro service to the login request and verifying and skipping resource service in the micro service to other requests; wherein the other requests are of a request type other than the login request; the resource service is used for acquiring the resources required by the request through a database and sending a command to the gateway centralized module through a socket according to the resources; the authentication service is used for verifying the account passwords which are logged in by the login request;
the gateway centralization module is used for forwarding the command to terminal equipment;
the terminal equipment is used for controlling the lighting equipment according to the command and returning the execution result to the resource service;
the resource service is further configured to return the execution result to the front end.
To achieve the above object, a second aspect of the present invention provides an access method, including:
receiving a request sent by a front end, and judging whether the request is a login request or not;
if the request is a login request, entering login authentication service to verify whether the account password in the login request is correct; if the account password in the login request is correct, generating a verification value, and returning the verification value to the front end and storing the verification value into a memory;
if the request is other requests, judging whether a request path of the request contains a verification value or not; if the verification value is not contained, the request fails; if the verification value is contained, judging whether the verification value is in a memory, if the verification value is not in the memory, the request fails, if the verification value is in the memory, judging whether the verification value is correct and is out of date, if the verification value is incorrect and/or out of date, the request fails, if the verification value is correct and is not out of date, jumping to a target resource server according to a request address of the request, so that the target resource server obtains corresponding target resources through a database, and sending a command to a gateway centralized module according to the resources, so that the terminal equipment controls the lighting equipment according to the command from the gateway centralized module.
With reference to the first aspect, in one possible implementation manner, the skipping to the target resource server according to the request address of the request includes: receiving a request sent by a front end, and searching all the resource servers requested through a request address; and determining a target resource server from all the resource servers, and jumping to the target resource server.
With reference to the first aspect, in one possible implementation manner, the obtaining, by the target resource server, a corresponding target resource through a database includes: judging whether the target resource server has remote call to other resource servers or not; if the target resource server has the remote call other resource servers, acquiring all needed remote call other resource servers from a registry, selecting a target other resource server from the other resource servers, and calling the target other resource server through remote procedure call so that the target other resource server acquires corresponding target resources through a database; and if the target resource server does not have the function of remotely calling other resource servers, enabling the target resource server to call a local server, and enabling the local server to acquire the corresponding target resource through a database.
With reference to the first aspect, in one possible implementation manner, before the searching all the resource servers requested by the request address, the method includes: receiving a request sent by a front end, and checking whether the front end is qualified for the request; if the front end has the request qualification, searching all resource servers requested by the request through the request address of the request; and if the front end does not qualify the request, intercepting the request.
With reference to the first aspect, in one possible implementation manner, determining the target resource server from all the resource servers includes: and determining a target resource server according to the hash result of the access address of the request.
With reference to the first aspect, in one possible implementation manner, the determining a target resource server from all the resource servers further includes: and preferentially determining the resource server with the shortest response time as the target resource server.
To achieve the above object, a third aspect of the present invention provides an access device comprising:
and a receiving judging module: the method comprises the steps of receiving a request sent by a front end, and judging whether the request is a login request or not;
a first access module: if the request is a login request, entering login authentication service to verify whether the account password in the login request is correct; if the account password in the login request is correct, generating a verification value, and returning the verification value to the front end and storing the verification value into a memory;
and a second access module: if the request is other requests, judging whether a request path of the request contains a verification value; if the verification value is not contained, the request fails; if the verification value is contained, judging whether the verification value is in a memory, if the verification value is not in the memory, the request fails, if the verification value is in the memory, judging whether the verification value is correct and is out of date, if the verification value is incorrect and/or out of date, the request fails, if the verification value is correct and is not out of date, jumping to a target resource server according to a request address of the request, so that the target resource server obtains corresponding target resources through a database, and sending a command to a gateway centralized module according to the resources, so that the terminal equipment controls the lighting equipment according to the command from the gateway centralized module.
To achieve the above object, a fourth aspect of the present invention provides a computer-readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of:
receiving a request sent by a front end, and judging whether the request is a login request or not;
if the request is a login request, entering login authentication service to verify whether the account password in the login request is correct; if the account password in the login request is correct, generating a verification value, and returning the verification value to the front end and storing the verification value into a memory;
if the request is other requests, judging whether a request path of the request contains a verification value or not; if the verification value is not contained, the request fails; if the verification value is contained, judging whether the verification value is in a memory, if the verification value is not in the memory, the request fails, if the verification value is in the memory, judging whether the verification value is correct and is out of date, if the verification value is incorrect and/or out of date, the request fails, if the verification value is correct and is not out of date, jumping to a target resource server according to a request address of the request, so that the target resource server obtains corresponding target resources through a database, and sending a command to a gateway centralized module according to the resources, so that the terminal equipment controls the lighting equipment according to the command from the gateway centralized module.
To achieve the above object, a fifth aspect of the present invention provides a computer device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of:
receiving a request sent by a front end, and judging whether the request is a login request or not;
if the request is a login request, entering login authentication service to verify whether the account password in the login request is correct; if the account password in the login request is correct, generating a verification value, and returning the verification value to the front end and storing the verification value into a memory;
if the request is other requests, judging whether a request path of the request contains a verification value or not; if the verification value is not contained, the request fails; if the verification value is contained, judging whether the verification value is in a memory, if the verification value is not in the memory, the request fails, if the verification value is in the memory, judging whether the verification value is correct and is out of date, if the verification value is incorrect and/or out of date, the request fails, if the verification value is correct and is not out of date, jumping to a target resource server according to a request address of the request, so that the target resource server obtains corresponding target resources through a database, and sending a command to a gateway centralized module according to the resources, so that the terminal equipment controls the lighting equipment according to the command from the gateway centralized module.
The embodiment of the invention has the following beneficial effects:
1) Receiving a request sent by a front end, judging whether the request is a login request, and if the request is the login request, entering a login authentication service to verify whether an account password in the login request is correct; if the account password in the login request is correct, generating a verification value, and returning the verification value to the front end and storing the verification value into a memory. The access request is verified through the verification value, and the problems of user management and authority control of multiple service nodes in the distributed system are solved.
2) If the request is another request, whether the request is successful is further verified by judging whether the request contains a verification value, specifically, judging whether the request contains the verification value, if the request does not contain the verification value, then judging whether the verification value is in a memory, if the request does not contain the verification value, then the request fails, if the verification value is not in the memory, then judging whether the verification value is correct and whether the verification value is out of date, if the verification value is incorrect and/or out of date, then the request fails, if the verification value is correct and is not out of date, then skipping to a target resource server according to the request address of the request, so that the target resource server obtains corresponding target resources through a database, and returns the resources to the front end. By further comparing the verification value with the cache value in the memory, the effectiveness of user management can be improved, and the accuracy of user login verification can be improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Wherein:
FIG. 1 is a block diagram of an intelligent lighting management and control system according to an embodiment of the present invention;
FIG. 2 is a flow chart of an access method based on an intelligent illumination management and control system according to an embodiment of the invention;
FIG. 3 is a block diagram of an access device according to an embodiment of the present invention;
fig. 4 is a block diagram of a computer device in an embodiment of the invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The embodiment of the invention provides a distributed intelligent lighting system, referring to fig. 1, fig. 1 is a structural block diagram of the distributed intelligent lighting system provided by the embodiment of the invention, and as shown in fig. 1, the distributed intelligent lighting system comprises a front end, a nginx, a gateway service, a micro service, a database, a gateway centralized module and terminal equipment. The front end may be a software device, such as a mobile phone, a computer, etc., and the user may control the front end to initiate a request, where the request is used to control the state of the terminal device, and the terminal device may be understood as a lighting device, for example, the user may control the lighting scheme of the terminal device by operating the front end to initiate a request; the rginx is used for selecting a server to jump according to a request path of a request and the number of servers deployed by the distributed intelligent lighting system; the gateway service is used for appointing authentication service in the micro service to the login request and verifying and skipping resource service in the micro service to other requests, wherein the other requests are request types except the login request; the resource service is used for acquiring the resources required by the request through the database and sending a command to the gateway centralized module through the socket according to the resources; the authentication service is used for verifying the account passwords which are logged in by the login request; the gateway centralizing module is used for forwarding the command to the terminal equipment; the terminal equipment is used for executing the command; the gateway centralized module is also used for returning the execution result of the terminal equipment to the resource service; the resource service is also used for returning the execution result to the front end.
Specifically, the micro service is in communication connection with a gateway centralized module, the gateway centralized module is in communication connection with a terminal device, and wireless or wired communication is included between the terminal device and the gateway centralized module, wherein the wired communication mode can be as follows: the gateway centralized module is connected with a gateway with a power carrier communication function, namely a PLC gateway serial port, and the PLC gateway is communicated with the terminal equipment through a power line.
Based on the above-mentioned distributed intelligent lighting system, an access method is described in detail below, referring to fig. 2, fig. 2 is a flow chart of an access method based on the distributed intelligent lighting system according to an embodiment of the present invention, as shown in fig. 2, where the access method specifically includes the following steps:
step S101, receiving a request sent by a front end, and judging whether the request is a login request or not.
The user controls the front end to send out the request, the gateway service receives the request sent by the front end, checks whether the front end is qualified for the request, intercepts the request if the front end is not qualified for the request, and judges whether the request is a login request if the front end is qualified for the request.
Step S102, if the request is a login request, entering a login authentication service to verify whether an account password in the login request is correct; if the account password in the login request is correct, generating a verification value, and returning the verification value to the front end and storing the verification value into a memory.
If the request is a login request, entering a login authentication service to verify whether the account password in the login request is correct, if the account password in the login request is correct, generating a verification value, returning the verification value to the front end and storing the verification value in a memory.
Step S103, if the request is other requests, judging whether a request path of the request contains a verification value or not; if the verification value is not contained, the request fails; if the verification value is contained, judging whether the verification value is in a memory, if the verification value is not in the memory, the request fails, if the verification value is in the memory, judging whether the verification value is correct and is out of date, if the verification value is incorrect and/or out of date, the request fails, if the verification value is correct and is not out of date, jumping to a target resource server according to a request address of the request, so that the target resource server obtains corresponding target resources through a database, and sending a command to a gateway centralized module according to the resources, so that the terminal equipment controls the lighting equipment according to the command from the gateway centralized module.
If the request is other requests, judging whether a request path of the request contains a verification value, and if the request path of the request does not contain the verification value, determining that the request fails; if the request path of the request contains a verification value, judging whether the verification value is in a memory, if the verification value is not in the memory, the request fails, if the verification value is in the memory, judging whether the verification value is correct and is out of date, if the verification value is incorrect and/or out of date, the request fails, if the verification value is correct and is not out of date, jumping to a target resource server according to the request address of the request, so that the target resource server obtains corresponding target resources through a database, sending a command to a gateway centralized module according to the resources, controlling lighting equipment by a terminal equipment command, returning an execution result to a resource service, and returning the execution result to the front end by the resource service.
Specifically, the jump to the target resource server according to the request address of the request comprises the following specific steps:
step S201, receiving a request sent by a front end, and searching all the resource servers of the request through a request address.
Step S202, determining a target resource server from all the resource servers, and jumping to the target resource server.
In the micro service, there are multiple resource services, each resource service corresponds to one resource server, and different resource services can enable the terminal device to execute different business services, for example, the micro service includes a video monitoring service, and the video monitoring service can enable the terminal device to execute a video monitoring function. In this embodiment, all the resource servers are found according to the request address of the request, the target resource server is determined from all the resource servers, and the jump is made to the target resource server. Specifically, in one possible implementation, the target resource server is determined according to the hash result of the access address of the request, that is, each request is allocated according to the hash result of the access ip, so that each guest fixedly accesses one resource server. In another possible implementation, the resource server with the shortest response time is preferentially determined as the target resource server, that is, the resource server is allocated according to the response time, and the resource server is preferentially allocated with the shortest response time. In another possible implementation, the target resource server is determined according to the hash result of the requested uniform resource location system, i.e. the request is allocated according to the hash result of the access url, so that each url is directed to the same resource server.
It should be noted that, all requests must first go through gateway service gateway, but the gateway service does not process traffic, but forwards the requests to the micro service according to a specific rule, and this process is called routing. When there are multiple target services routed, load balancing is required. When the request flow is too high, the request is released in the gateway according to the speed which can be accepted by the downstream micro service, so that the service pressure is prevented from being too high.
Step 301, judging whether the target resource server has remote call to other resource servers.
Further, after the jump to the target resource server, whether other resource servers are called remotely exists in the target resource server is judged.
Step S302, if there are other remote call resource servers in the target resource server, the target other resource server is called through remote procedure call by acquiring all the needed other remote call resource servers from the registry and selecting the target other resource server from the other resource servers, so that the target other resource server acquires the corresponding target resource through the database.
If the target resource server has the remote call other resource servers, the target other resource servers are selected from the other resource servers by acquiring all the needed remote call other resource servers from the registry, and the target other resource servers are called by remote procedure call, so that the target other resource servers acquire corresponding target resources from the database.
Step S303, if the target resource server does not have other remote call resource servers, the target resource server is enabled to call a local server, and the local server is enabled to acquire corresponding target resources through a database.
And if the target resource server does not have the function of remotely calling other resource servers, the target resource server calls a local server, and the local server acquires the corresponding target resource from the database.
Based on the method, a request sent by the front end is received, whether the request is a login request is judged, and if the request is the login request, login authentication service is entered to verify whether an account password in the login request is correct; if the account password in the login request is correct, generating a verification value, and returning the verification value to the front end and storing the verification value into a memory. The access request is verified through the verification value, and the problems of user management and authority control of multiple service nodes in the distributed system are solved.
If the request is another request, whether the request is successful is further verified by judging whether the request contains a verification value, specifically, judging whether the request contains the verification value, if the request does not contain the verification value, the request fails, if the request contains the verification value, judging whether the verification value is in a memory, if the verification value is not in the memory, the request fails, if the verification value is in the memory, judging whether the verification value is correct and whether the verification value is out of date, if the verification value is incorrect and/or out of date, the request fails, if the verification value is correct and is out of date, jumping to a target resource server according to a request address of the request, and enabling the target resource server to acquire corresponding target resources through a database. By further comparing the verification value with the cache value in the memory, the effectiveness of user management can be improved, and the accuracy of user login verification can be improved.
In order to better implement the above method, an access device is provided in an embodiment of the present invention, referring to fig. 3, and fig. 3 is an access device provided in an embodiment of the present invention, as shown in fig. 3, the device 30 includes:
the reception judgment module 301: the method comprises the steps of receiving a request sent by a front end, and judging whether the request is a login request or not;
the first access module 302: if the request is a login request, entering login authentication service to verify whether the account password in the login request is correct; if the account password in the login request is correct, generating a verification value, and returning the verification value to the front end and storing the verification value into a memory;
the second access module 303: if the request is other requests, judging whether a request path of the request contains a verification value; if the verification value is not contained, the request fails; if the verification value is contained, judging whether the verification value is in a memory, if the verification value is not in the memory, the request fails, if the verification value is in the memory, judging whether the verification value is correct and is out of date, if the verification value is incorrect and/or out of date, the request fails, if the verification value is correct and is not out of date, jumping to a target resource server according to a request address of the request, so that the target resource server obtains corresponding target resources through a database, and sending a command to a gateway centralized module according to the resources, so that the terminal equipment controls the lighting equipment according to the command from the gateway centralized module.
In one possible design, the second access module 303 is specifically configured to: receiving a request sent by a front end, and searching all the resource servers requested through a request address; and determining a target resource server from all the resource servers, and jumping to the target resource server.
In one possible design, the second access module 303 is specifically configured to: judging whether the target resource server has remote call to other resource servers or not; if the target resource server has the remote call other resource servers, acquiring all required remote call other resource servers from a registry, selecting a target other resource server from the other resource servers, and calling the target other resource server through remote procedure call; acquiring resources from other resource servers of the target; and if the target resource server does not have the function of remotely calling other resource servers, enabling the target resource server to call a local server, and enabling the local server to acquire the corresponding target resource through a database.
In one possible design, the second access module 303 is specifically configured to: receiving a request sent by a front end, and checking whether the front end is qualified for the request; if the front end has the request qualification, searching all resource servers requested by the request through the request address of the request; and if the front end does not qualify the request, intercepting the request.
In one possible design, the second access module 303 is specifically configured to: and determining a target resource server according to the hash result of the access address of the request.
In one possible design, the second access module 303 is specifically configured to: and preferentially determining the resource server with the shortest response time as the target resource server.
Based on the device, a request sent by the front end is received, whether the request is a login request is judged, and if the request is the login request, login authentication service is entered to verify whether an account password in the login request is correct; if the account password in the login request is correct, generating a verification value, and returning the verification value to the front end and storing the verification value into a memory. The access request is verified through the verification value, and the problems of user management and authority control of multiple service nodes in the distributed system are solved. If the request is another request, whether the request is successful is further verified by judging whether the request contains a verification value, specifically, judging whether the request contains the verification value, if the request does not contain the verification value, then judging whether the verification value is in a memory, if the request does not contain the verification value, then the request fails, if the verification value is not in the memory, then judging whether the verification value is correct and whether the verification value is out of date, if the verification value is incorrect and/or out of date, then the request fails, if the verification value is correct and is not out of date, then skipping to a target resource server according to the request address of the request, so that the target resource server obtains corresponding target resources through a database, and returns the resources to the front end. By further comparing the verification value with the cache value in the memory, the effectiveness of user management can be improved, and the accuracy of user login verification can be improved.
FIG. 4 illustrates an internal block diagram of a computer device in one embodiment. The computer device may specifically be a terminal or a server. As shown in fig. 4, the computer device includes a processor, a memory, and a network interface connected by a system bus. The memory includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program which, when executed by a processor, causes the processor to carry out all the steps of the above-described method. The internal memory may also have stored therein a computer program which, when executed by a processor, causes the processor to perform all the steps of the method described above. Those skilled in the art will appreciate that the structures shown in FIG. 4 are block diagrams only and do not constitute a limitation of the computer device on which the present aspects apply, and that a particular computer device may include more or less components than those shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer device is presented comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the aforementioned method.
In one embodiment, a computer-readable storage medium is provided, storing a computer program which, when executed by a processor, causes the processor to perform the steps of the aforementioned method.
Those skilled in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by a computer program for instructing relevant hardware, where the program may be stored in a non-volatile computer readable storage medium, and where the program, when executed, may include processes in the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. The distributed intelligent lighting system is characterized by comprising a front end, a nginx, a gateway service, a micro service, a database, a gateway centralized module and terminal equipment;
the front end is used for initiating a request;
the nginx is used for selecting server jump according to a request path of a request and the number of servers deployed by the distributed intelligent lighting system;
the gateway service is used for appointing authentication service in the micro service to the login request and verifying and skipping resource service in the micro service to other requests; wherein the other requests are of a request type other than the login request; the resource service is used for acquiring the resources required by the request through a database and sending a command to the gateway centralized module through a socket according to the resources; the authentication service is used for verifying the account passwords which are logged in by the login request;
the gateway centralization module is used for forwarding the command to terminal equipment;
the terminal equipment is used for controlling the lighting equipment according to the command and returning the execution result to the resource service;
the resource service is further configured to return the execution result to the front end.
2. An access method, characterized in that it is applied to the distributed intelligent lighting system of claim 1, said method comprising:
receiving a request sent by a front end, and judging whether the request is a login request or not;
if the request is a login request, entering login authentication service to verify whether the account password in the login request is correct; if the account password in the login request is correct, generating a verification value, and returning the verification value to the front end and storing the verification value into a memory;
if the request is other requests, judging whether a request path of the request contains a verification value or not; if the verification value is not contained, the request fails; if the verification value is contained, judging whether the verification value is in a memory, if the verification value is not in the memory, the request fails, if the verification value is in the memory, judging whether the verification value is correct and is out of date, if the verification value is incorrect and/or out of date, the request fails, if the verification value is correct and is not out of date, jumping to a target resource server according to a request address of the request, so that the target resource server obtains corresponding target resources through a database, sending a command to a gateway centralized module according to the target resources, and enabling a terminal device to control lighting equipment according to the command from the gateway centralized module.
3. The method of claim 2, wherein the jumping to the target resource server according to the request address of the request comprises:
receiving a request sent by a front end, and searching all the resource servers requested through a request address;
and determining a target resource server from all the resource servers, and jumping to the target resource server.
4. The method of claim 2, wherein the target resource server obtains the corresponding target resource through a database, comprising:
judging whether the target resource server has remote call to other resource servers or not;
if the target resource server has the remote call other resource servers, acquiring all needed remote call other resource servers from a registry, selecting a target other resource server from the other resource servers, and calling the target other resource server through remote procedure call so that the target other resource server acquires corresponding target resources through a database;
and if the target resource server does not have the function of remotely calling other resource servers, enabling the target resource server to call a local server, and enabling the local server to acquire the corresponding target resource through a database.
5. The method of claim 2, wherein prior to searching all resource servers requested by the request address, comprising:
receiving a request sent by a front end, and checking whether the front end is qualified for the request;
if the front end has the request qualification, searching all resource servers requested by the request through the request address of the request; and if the front end does not qualify the request, intercepting the request.
6. The method of claim 2, wherein said determining a target resource server from among all resource servers comprises:
and determining a target resource server according to the hash result of the access address of the request.
7. The method of claim 2, wherein said determining a target resource server from among all resource servers further comprises:
and preferentially determining the resource server with the shortest response time as the target resource server.
8. An access device, the device comprising:
and a receiving judging module: the method comprises the steps of receiving a request sent by a front end, and judging whether the request is a login request or not;
a first access module: if the request is a login request, entering login authentication service to verify whether the account password in the login request is correct; if the account password in the login request is correct, generating a verification value, and returning the verification value to the front end and storing the verification value into a memory;
and a second access module: if the request is other requests, judging whether a request path of the request contains a verification value; if the verification value is not contained, the request fails; if the verification value is contained, judging whether the verification value is in a memory, if the verification value is not in the memory, the request fails, if the verification value is in the memory, judging whether the verification value is correct and is out of date, if the verification value is incorrect and/or out of date, the request fails, if the verification value is correct and is not out of date, jumping to a target resource server according to a request address of the request, so that the target resource server obtains corresponding target resources through a database, sending a command to a gateway centralized module according to the target resources, and enabling a terminal device to control lighting equipment according to the command from the gateway centralized module.
9. A computer readable storage medium storing a computer program, which when executed by a processor causes the processor to perform the steps of the method according to any one of claims 1 to 7.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program which, when executed by the processor, causes the processor to perform the steps of the method of any of claims 1 to 7.
CN202310090639.2A 2023-01-14 2023-01-14 Distributed intelligent lighting system, access method and related device Pending CN116455594A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310090639.2A CN116455594A (en) 2023-01-14 2023-01-14 Distributed intelligent lighting system, access method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310090639.2A CN116455594A (en) 2023-01-14 2023-01-14 Distributed intelligent lighting system, access method and related device

Publications (1)

Publication Number Publication Date
CN116455594A true CN116455594A (en) 2023-07-18

Family

ID=87119047

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310090639.2A Pending CN116455594A (en) 2023-01-14 2023-01-14 Distributed intelligent lighting system, access method and related device

Country Status (1)

Country Link
CN (1) CN116455594A (en)

Similar Documents

Publication Publication Date Title
CN108833521B (en) Message pushing method, device, system, computer equipment and storage medium
CN113596191B (en) Data processing method, network element equipment and readable storage medium
CN110602169B (en) Service calling method and device, computer equipment and storage medium
CN103986741A (en) Cloud data system, cloud data center, and resource management method of the cloud data center
CN112822061B (en) Method and system for exposing service to outside by edge node
CN108595280B (en) Interface adaptation method and device, computer equipment and storage medium
CN110995617A (en) MQTT-based data transmission method, device, computer equipment and storage medium
CN111159233A (en) Distributed caching method, system, computer device and storage medium
CN112600801A (en) Flow access control method, equipment and storage medium
CN114281263A (en) Storage resource processing method, system and equipment of container cluster management system
CN112291365A (en) Access balance processing method and device, computer equipment and storage medium
CN110312140B (en) Live broadcast data processing method, device and system and computer readable storage medium
CN103607410A (en) Content access method and equipment
CN110933192A (en) Local area network IP address allocation method, device, system and computer equipment
CN108366087B (en) ISCSI service realization method and device based on distributed file system
CN114143090A (en) Firewall deployment method, device, equipment and medium based on network security architecture
CN112671945A (en) Method, device, computer equipment and storage medium for managing IP proxy pool
CN103138961B (en) server control method, controlled server and central control server
CN107682271B (en) Method and device for generating routing line
CN116455594A (en) Distributed intelligent lighting system, access method and related device
CN110545336A (en) IP address replacing method, device, computer equipment and storage medium
CN110784510A (en) Method for accessing target service node to bus and information interaction method of service node
CN114173396B (en) Method and device for determining terminal networking time, electronic equipment and storage medium
CN111064675A (en) Access flow control method, device, network equipment and storage medium
CN114338774A (en) Management method and device of Internet of things equipment, computer 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