CN115374023A - Unit addressing method and device and electronic equipment - Google Patents

Unit addressing method and device and electronic equipment Download PDF

Info

Publication number
CN115374023A
CN115374023A CN202210887587.7A CN202210887587A CN115374023A CN 115374023 A CN115374023 A CN 115374023A CN 202210887587 A CN202210887587 A CN 202210887587A CN 115374023 A CN115374023 A CN 115374023A
Authority
CN
China
Prior art keywords
service
target
unit
address
identifier
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.)
Granted
Application number
CN202210887587.7A
Other languages
Chinese (zh)
Other versions
CN115374023B (en
Inventor
刘磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongdian Jinxin Software Co Ltd
Original Assignee
Zhongdian Jinxin Software 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 Zhongdian Jinxin Software Co Ltd filed Critical Zhongdian Jinxin Software Co Ltd
Priority to CN202210887587.7A priority Critical patent/CN115374023B/en
Publication of CN115374023A publication Critical patent/CN115374023A/en
Application granted granted Critical
Publication of CN115374023B publication Critical patent/CN115374023B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/04Addressing variable-length words or parts of words

Abstract

The embodiment of the application provides a unit addressing method, a unit addressing device and electronic equipment, and relates to the field of network communication. The method comprises the following steps: the method comprises the steps of obtaining a first service request, and determining a first service identifier of a first target service called by the first service request, wherein the first service identifier comprises a plurality of characters; intercepting at least one character from a plurality of characters as a first key character according to a preconfigured key character; and determining a first target unit address corresponding to the first key character according to the corresponding relation between the pre-configured key character and the unit address, wherein the first target unit address is the address of the unit where the first target service is located. The method and the device realize that the service request is automatically transmitted to the corresponding unit on the premise of rarely changing the application program, and intercept a plurality of characters, thereby greatly reducing the data volume needing to be stored.

Description

Unit addressing method and device and electronic equipment
Technical Field
The present application relates to the field of network communication technologies, and in particular, to a unit addressing method, an electronic device, and a computer-readable storage medium.
Background
At present, on the mass data processing of a large system, a great access pressure is caused to a business system, under a novel system, an enterprise can segment so much mass data, for example, according to an administrative region or according to a data volume (for example, each ten million is one magnitude), the segmented mass data are stored in different physical storages, then a plurality of sets of application programs are deployed on the system, so that an original system for storing the mass data is formed, a plurality of independent 'unit' systems are formed, each unit only bears the flow of own unit data, for example, only stores Beijing data in Beijing, and only stores Shanghai data in Shanghai, under the condition, how to realize the automatic transmission of a service request to a corresponding unit for data operation by reducing the change of the application programs as much as possible is also a problem to be solved.
In the related technology, the corresponding relation between a plurality of characters in the service identifier of the service request and the unit address of the target service is directly stored in a storage medium in a directory form, firstly, the terminal sends at least one service calling request to the gateway to call the at least one target service, after receiving the at least one service calling request, the gateway sends a query request to the storage medium, acquires the unit address of the unit where the at least one target service is located from the storage medium, and sends the at least one service calling request to the unit where the at least one target service is located. In the existing scheme, on one hand, the gateway is used for service positioning and service distribution, and the gateway is heavily loaded in operation; on the other hand, the length of a plurality of characters stored in a storage medium is long, which results in a large data volume and requires a storage medium having a hierarchical directory relationship, and the demand for the storage medium is high.
Disclosure of Invention
Embodiments of the present application provide a method and an apparatus for cell addressing, an electronic device, a computer-readable storage medium, and a computer program product, which can solve the above problems. The technical scheme is as follows:
according to an aspect of an embodiment of the present application, there is provided a method of cell addressing, the method including:
the method comprises the steps of obtaining a first service request, determining a first service identifier of a first target service called by the first service request, wherein the first service request is used for requesting to call a first target service on a unit, and the first service identifier comprises a plurality of characters;
intercepting at least one character from a plurality of characters as a first key character according to a preset key character;
and determining a first target unit address corresponding to the first key character according to the corresponding relation between the pre-configured key character and the unit address, wherein the first target unit address is the address of the unit where the first target service is located.
As an alternative embodiment, determining the first target unit address corresponding to the first key character further includes:
the first target unit address and the first service request are sent to the gateway to instruct the gateway to send the first service request to the first target unit address.
As an alternative embodiment, the sending the first target unit address and the first service request to the gateway further includes:
acquiring a second service request, wherein the second service request is used for calling a second target service and determining a second service identifier of the second target service, and the second service identifier comprises a plurality of characters;
intercepting at least one character from the second service identifier as a second key character according to a preset key character;
and determining a second target unit address and a second target unit identifier corresponding to the second key character according to the corresponding relation between the pre-configured key character and the unit address, wherein the second target unit address is the address of the second target service.
As an optional embodiment, determining a second target unit address and a second target unit identifier corresponding to the second key character, and then further includes:
if the second target unit identification is different from the first target unit identification, the second target unit address and the second service request are sent to the first target service to indicate the first target service to perform the following operations:
and sending the second service request to a second target unit address, and calling a second target service, wherein the first target unit identifier is the unit identifier of the unit where the first target service is located.
As an optional embodiment, determining a second target unit address and a second target unit identifier corresponding to the second key character, and then further includes:
and if the second target unit identifier is the same as the unit identifier of the first target service, sending a second service request to the first target service to indicate the first target service to send the second service request to the first target unit address so as to call the second target service.
As an alternative embodiment, intercepting at least one character from the plurality of characters as a first key character according to a preconfigured key character, further comprising:
and obtaining a plurality of characters from the first service identifier according to the occupied field of the plurality of pre-configured characters in the first service identifier.
As an alternative embodiment, determining a first target cell address corresponding to a first key character according to a correspondence between preconfigured key characters and cell addresses includes:
determining a first target unit identifier corresponding to the first key character according to the corresponding relation between the pre-configured key character and the unit identifier;
and determining a first target unit address corresponding to the first target unit identifier according to the corresponding relation between the pre-configured unit identifier and the unit address.
According to a second aspect of embodiments of the present application, there is provided a cell addressing apparatus comprising:
a first obtaining module, configured to obtain a first service request, where the first service request is used to request to invoke a first target service on a unit, and determine a first service identifier of the first target service, where the first service identifier includes multiple characters;
the first intercepting module is used for intercepting at least one character from a plurality of characters to serve as a first key character;
and the first determining module is used for determining a first target unit address corresponding to the first key character according to the corresponding relation between the pre-configured key character and the unit address, wherein the first target unit address is the address of the first target service.
As an alternative embodiment, determining the first target unit address corresponding to the first key character further includes:
and the sending module is used for sending the first target unit address and the first service request to the gateway so as to indicate the gateway to send the first service request to the first target unit address.
As an alternative embodiment, the sending the first target unit address and the first service request to the gateway further includes:
the second obtaining module is used for obtaining a second service request, the second service request is used for calling a second target service and determining a second service identifier of the second target service, and the second service identifier comprises a plurality of characters;
the second intercepting module is used for intercepting at least one character from the second service identifier as a second key character according to the preconfigured key character;
and the second determining module is used for determining a second target unit address and a second target unit identifier corresponding to the second key character according to the corresponding relation between the pre-configured key character and the unit address, wherein the second target unit address is the address of the second target service.
As an optional embodiment, determining a second target unit address and a second target unit identifier corresponding to the second key character, and then further includes:
a first judging and sending module, configured to send the second target unit address and the second service request to the first target service to indicate the first target service to perform the following operations if the second target unit identifier is different from the first target unit identifier:
and sending the second service request to a second target unit address, and calling a second target service, wherein the first target unit identifier is the unit identifier of the unit where the first target service is located.
As an optional embodiment, determining a second target unit address and a second target unit identifier corresponding to the second key character, and then further includes:
and the second judgment sending module is used for sending a second service request to the first target service if the second target unit identifier is the same as the unit identifier of the first target service, so as to indicate the first target service to send the second service request to the first target unit address, and call the second target service.
As an alternative embodiment, intercepting at least one character from the plurality of characters as a first key character according to a preconfigured key character, further comprising:
and the character acquisition module is used for acquiring a plurality of characters from the first service identifier according to the field occupied by the plurality of pre-configured characters in the first service identifier.
As an alternative embodiment, determining a first target cell address corresponding to a first key character according to a correspondence between preconfigured key characters and cell addresses includes:
the identification determining module is used for determining a first target unit identification corresponding to the first key character according to the corresponding relation between the pre-configured key character and the unit identification;
and an address determination module. And the unit address determining unit is used for determining a first target unit address corresponding to the first target unit identifier according to the corresponding relation between the pre-configured unit identifier and the unit address.
According to a third aspect of embodiments of the present application, there is provided an electronic apparatus including: a memory, a processor and a computer program stored on the memory, the processor executing the computer program to implement the steps of the unit addressing method of the first aspect described above.
According to a fourth aspect of embodiments herein, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the unit addressing method of the first aspect described above.
The technical scheme provided by the embodiment of the application has the following beneficial effects: determining a first service identifier of a first target service called by a first service request by acquiring the first service request, wherein the first service request is used for requesting to call a first target service on a unit, and the first service identifier comprises a plurality of characters; intercepting at least one character from a plurality of characters as a first key character according to a preset key character, and greatly reducing the data volume needing to be stored by intercepting the plurality of characters; and determining a first target unit address corresponding to the first key character according to the corresponding relation between the pre-configured key character and the unit address, wherein the first target unit address is the address of the unit where the first target service is located. The service request is automatically transmitted to the corresponding unit, and the corresponding relation between the characters and the unit address can be stored in any storage medium, so that the economic burden is reduced on one hand, and the burden of program operation is reduced on the other hand.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic diagram of an architecture for implementing a unit addressing method according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a cell addressing method according to an embodiment of the present application;
fig. 3 is a flowchart illustrating a method for addressing a unit of an inter-service request according to an embodiment of the present application;
fig. 4 is a schematic flowchart of a unit addressing method based on a terminal request and an inter-service request according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device of a cell addressing method according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the embodiments set forth below in connection with the drawings are exemplary descriptions for explaining technical solutions of the embodiments of the present application, and do not limit the technical solutions of the embodiments of the present application.
As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, information, data, steps, operations, elements, and/or components, but do not preclude the presence or addition of other features, information, data, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. The term "and/or" as used herein indicates at least one of the items defined by the term, e.g., "a and/or B" can be implemented as "a", or as "B", or as "a and B".
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The present application provides a unit addressing method, apparatus, electronic device, computer-readable storage medium, and computer program product, which are intended to solve the above technical problems in the prior art.
The technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application will be described below through descriptions of several exemplary embodiments. It should be noted that the following embodiments may be referred to, referred to or combined with each other, and the description of the same terms, similar features, similar implementation steps, etc. in different embodiments is not repeated.
Referring to fig. 1, fig. 1 is a schematic diagram of an architecture for implementing a unit addressing method according to an embodiment of the present application, where the architecture includes: terminal 101, unit addressing means 102, gateway 103, unit 104, storage server 105. The specific application scene is as follows: the terminal 101 sends a service call request to the gateway 103, the unit addressing device 102 intercepts the service call request sent by the terminal 101, combines with the storage server 105 to process the service call request to obtain a target unit address of the service call request, sends the target unit address and the service request to the gateway 103, and the gateway 103 sends the service request to the unit address where the target service is located.
The terminal 101 may be a computer device, such as a desktop computer, a notebook computer, a bank self-service terminal, and the like, and the terminal 101 may send a service request to the gateway for invoking the target service by the terminal 101.
The unit addressing device 102 is mainly configured to intercept a service request sent by the terminal 101, analyze the service request, calculate a unit address where a target service is located according to a data correspondence relation queried in the storage server 105, and send the calculated target unit address and the service request to the gateway 103 together, where the unit addressing device may be a unitized routing component.
The gateway 103 is mainly configured to send a service request to the target unit address, and the gateway receives the target unit address and the service request returned by the unit addressing device 102, and sends the service request to the target unit address according to the target unit address.
The unit 104 is mainly used for storing the segmented data and services, and the same service may be deployed in each unit, but each unit stores different data, so that a target unit address needs to be specified when the terminal 101 calls the service. The unit 104 may receive an external service request, and the service in the unit may also issue a call request to the external device.
The storage server 105 is mainly used for storing data required for calculating the target unit address, and when the unit addressing device 102 performs operation, the storage server 105 can be queried for the required data.
An embodiment of the present application provides a cell addressing method, as shown in fig. 2, which exemplarily shows a flow chart of the cell addressing method provided in the embodiment of the present application, where the method at least may include:
s201, acquiring a first service request, and determining a first service identifier of a first target service called by the first service request, wherein the first service request is used for requesting to call a first target service on a unit, and the first service identifier comprises a plurality of characters;
in the embodiment of the present invention, when a user wants to implement a function of a certain service, a request is initiated through a terminal, the terminal may adopt a visual interface, and operations that the user can perform at the terminal include, but are not limited to, a click operation, a voice input, and the like. Here, the service means a generic term of various services that can support and realize various functions in the present invention, and may be an application program.
As an optional embodiment, when the user wants to query the total sales of the article a in the shanghai region, and the user submits the task at the terminal, only the query task instruction needs to be selected on the interface, for example, "shanghai region", "article a" and "total sales", the terminal will specify the service to be invoked according to the query instruction, and send the first service request to the gateway.
Specifically, a request sent by the terminal to the gateway is intercepted by the unit addressing device, where the first service request includes a first service identifier of the first target service, the first service identifier may be a packet/parameter of the first service request, a plurality of characters included in the first service request may be a keyword of the packet/parameter of the first service request, and the length of the keyword is usually longer, for example, 6323423453456.
S202, intercepting at least one character from a plurality of characters as a first key character according to a preset key character;
in this embodiment of the application, if the first service identifier does not include a character corresponding to the target cell address, that is, the message/parameter of the first service request does not include information of the target cell address, the cell addressing device may intercept a certain number of characters from the plurality of characters as the first key character according to a pre-configured correspondence between the key character and the cell address, for example, may intercept a one-bit end sign, intercept a two-bit end sign, and the like.
S203, determining a first target unit address corresponding to the first key character according to the corresponding relation between the pre-configured key character and the unit address, wherein the first target unit address is the address of the unit where the first target service is located.
Specifically, the correspondence between the preconfigured key character and the unit address is established through the correspondence between the key character and the unit identifier and the correspondence between the unit identifier and the unit address, where table 1 and table 2 exemplarily show the correspondence between the key character and the unit identifier.
When the 2-bit tail numbers of the plurality of characters are pre-configured to correspond to the unit identifiers, the corresponding relation between the key characters and the unit identifiers is as follows:
key character Unit identification
0 Unit 1
1 Unit 2
2 Unit 3
…… ……
99 Unit 100
TABLE 1A table of correspondences between key characters and cell identifiers
When each million of stepping values of a plurality of characters are preset to correspond to one unit identifier, the corresponding relation between the key character and the unit identifier is as follows:
key character Unit identification
0 Unit 1
10000000 (inner) Unit 2
20000000 (inner) Unit 3
…… ……
90000000 (inner) Unit 10
TABLE 2 Another correspondence table of key characters and unit identifiers
On the basis of the foregoing embodiments, as an optional embodiment, determining a first target unit address corresponding to a first key character, and then further includes:
the first target unit address and the first service request are sent to the gateway to instruct the gateway to send the first service request to the first target unit address.
And after receiving the first service request and the first target unit address, the gateway can send the first service request to the first target unit address, thereby realizing the calling of the first target service.
On the basis of the foregoing embodiments, as an optional embodiment, if the service identifier of the first target service includes a character corresponding to the first target unit address, the first target unit address and the first service request are sent to the gateway.
In this embodiment of the application, the service identifier of the first target service may include a character corresponding to the first target unit address, that is, the service packet/parameter of the first target service may include the unit address of the unit where the target service is located, and at this time, the first target unit address of the first target service does not need to be calculated, but the first service request and the target unit address are directly sent to the gateway, so as to instruct the gateway to directly send the first service request to the first target unit address for invoking the target service.
Referring to fig. 3, on the basis of the foregoing embodiments, as an alternative embodiment, fig. 3 exemplarily shows that the present application sends the first target unit address and the first service request to the gateway, and then further includes:
s301, acquiring a second service request, wherein the second service request is used for calling a second target service and determining a second service identifier of the second target service, and the second service identifier comprises a plurality of characters;
in this embodiment of the application, after the first target service is invoked, the first target service may also issue a second service request to invoke a second target service, where the second service identifier may be a message/parameter of the second service request, and the second target service also includes multiple characters, where the multiple characters included in the second service identifier may be keywords of the message/parameter of the second service request, and the length of the keywords is usually longer, for example, 6333123453111.
S302, intercepting at least one character from a second service identifier as a second key character according to a preset key character;
specifically, the unit addressing device may intercept a certain number of characters from the plurality of characters as the second key character according to a pre-configured correspondence between the key character and the unit address, for example, may intercept a first tail number, intercept a second tail number, and so on.
S303, according to the corresponding relation between the preset key character and the unit address, determining a second target unit address and a second target unit identifier corresponding to the second key character, wherein the second target unit address is the address of the second target service.
The corresponding relation between the key characters and the unit addresses is established through the corresponding relation between the key characters and the unit identifiers and the corresponding relation between the unit identifiers and the unit addresses.
On the basis of the foregoing embodiments, as an optional embodiment, determining a second target unit address corresponding to a second key character according to a correspondence between a preconfigured key character and a unit address includes:
determining a second target unit identifier corresponding to a second key character according to the corresponding relation between the pre-configured key character and the unit identifier;
and determining a second target unit address corresponding to the second target unit identifier according to the corresponding relation between the pre-configured unit identifier and the unit address.
The corresponding relation between the key characters and the unit addresses which are pre-configured in the embodiment of the application is established through the corresponding relation between the key characters and the unit identifiers and the corresponding relation between the unit identifiers and the unit addresses. The correspondence of the key character "0" to the cell address "http (s)// cell 1" can be realized, for example, by configuring that the key character "0" corresponds to "cell 1", and that cell 1 "corresponds to the cell address" http (s)// cell 1 "of cell 1.
On the basis of the above embodiments, as an alternative embodiment, the method further includes:
and if the service identifier of the second target service comprises characters corresponding to the second target unit address, sending the target unit address and the second service request to the first target service.
In this embodiment of the application, the service identifier of the second target service may include a character corresponding to the first target unit address, that is, the service message/parameter of the second service request may include the unit address of the unit where the second target service is located, and at this time, the second target unit address does not need to be calculated, but the first service request and the target unit address are directly sent to the first target service, so as to indicate that the first target service directly sends the first service request to the first target unit address for invoking the target service.
On the basis of the foregoing embodiments, as an optional embodiment, determining a second target unit address and a second target unit identifier corresponding to the second key character, and then further includes:
if the second target unit identification is not the same as the first target unit identification, the second target unit address and the second service request are sent to the first target service to indicate the first target service to perform the following operations:
and sending the second service request to a second target unit address, and calling a second target service, wherein the first target unit identifier is the unit identifier of the unit where the first target service is located.
In this embodiment of the present application, after the first target service is started, the unit identifier corresponding to the first target service may be determined according to the correspondence between the service and the unit identifier configured in advance in the service, and the second target unit identifier calculated and determined by the unit addressing device is compared with the first target unit identifier, and when the second target unit identifier and the first target unit identifier are not the same, it is determined that the units where the second target service and the first target service are located are not the same.
The unit addressing device sends the second target unit address and the second service request to the first target service together, and the first target service directly sends the second service request to the second target service after obtaining the second target unit address, so that the direct connection between the service and the service is realized. In the embodiment of the application, when the service sends the call request to the external unit, the service does not need to be filtered by the routing gateway and distributed by the gateway at the same time, but the direct connection between the service and the service is realized through the unit addressing device, and the service does not need to be connected through the gateway, so that the expenditure is saved.
On the basis of the foregoing embodiments, as an optional embodiment, determining a second target unit address and a second target unit identifier corresponding to a second key character, and then further includes:
if the second target unit identification is the same as the unit identification of the first target service, the second service request is sent to the first target service; to instruct the first target service to send a second service request to the first target unit address to invoke the second target service.
In this embodiment, the second target service may be in the same cell as the first target service, and the second target cell identifier determined by the cell addressing device is compared with the first target cell identifier, and if the second target service and the first target service are the same, the second target service and the first target service are in the same cell.
The unit addressing device returns the information to the first target service, and the first target service can directly call the second target service in the unit.
For example, when a user goes to a bank counter to take money from a bank card, and the money is taken, the balance is displayed, and if service a represents a money taking function and service b represents a balance calculation and display function, service a calls service b. Then, after the user performs money fetching operation on the counter, the terminal calls the service a to perform the money fetching function, and the service a calls the service b of the same unit to calculate and display the balance.
On the basis of the foregoing embodiments, as an optional embodiment, according to a preconfigured key character, intercepting at least one character from a plurality of characters as a first key character, further includes:
and obtaining a plurality of characters from the first service identifier according to the occupied field of the plurality of pre-configured characters in the first service identifier.
In the embodiment of the present application, after intercepting the service identifier, the unit addressing device may parse the service identifier, and according to the position of the preconfigured multiple characters in the service identifier, which have a corresponding relationship with the target service address, the position of the keyword in the service request parameter/message may be the position in the parameter/message, for example, the position may be in a hierarchical relationship format: the method includes the steps of/root/level 1/level2, pre-configuring a plurality of characters with level2 in a storage medium, and analyzing a service identifier by a unit addressing device according to storage positions of the pre-configured characters in the service identifier to obtain the plurality of characters, wherein the plurality of characters obtained from a storage path with level2 are '6323433123453456'.
On the basis of the above embodiments, as an optional embodiment, the method further includes:
and if the service identifier of the second target service comprises characters corresponding to the second target unit address, the unit addressing device sends the target unit address and the second service request to the first target service.
In this embodiment of the application, the service identifier of the second target service may include a character corresponding to the second target unit address, that is, the service packet/parameter of the second service request may include the unit address of the unit where the second target service is located, at this time, the unit addressing device does not need to calculate the second target unit address, but directly sends the first service request and the target unit address to the first target service, and the first target service directly sends the first service request to the first target unit address for invoking the target service.
On the basis of the foregoing embodiments, as an optional embodiment, determining a first target unit address corresponding to a first key character according to a correspondence between a preconfigured key character and a unit address includes:
determining a first target unit identifier corresponding to the first key character according to the corresponding relation between the pre-configured key character and the unit identifier;
and determining a first target unit address corresponding to the first target unit identifier according to the corresponding relation between the pre-configured unit identifier and the unit address.
The corresponding relation between the key characters and the unit addresses which are pre-configured in the embodiment of the application is established through the corresponding relation between the key characters and the unit identifiers and the corresponding relation between the unit identifiers and the unit addresses. The correspondence of the key character "7" to the cell address "http (s)// cell 1" can be realized, for example, by configuring the key character "7" to correspond to "cell 1", and the cell 1 "to correspond to the cell address" http (s)// cell 1 "of cell 1.
On the basis of the foregoing embodiments, as an optional embodiment, determining a target unit address corresponding to a key character according to a predetermined correspondence between the key character and the unit address in the present application includes:
the unit addressing device determines a target unit identifier corresponding to the key character according to the corresponding relation between the pre-configured key character and the unit identifier;
and determining a target unit address corresponding to the target unit identifier according to the corresponding relation between the pre-configured unit identifier and the unit address.
As an alternative embodiment, the method further comprises:
for each unit, storing a correspondence between a unit identifier of the unit and a unit address of the unit in a storage server;
in the embodiment of the present application, the preconfigured unit identifiers correspond to unit addresses, that is, one unit identifier uniquely corresponds to one unit address. The unit identifier may also be a unit name, and each unit may customize a corresponding identifier, for example, the identifier may be set for different units according to a region where the unit is located, a numerical sequence, and the like. The unit address is an address of the unit, which is accessible, and is commonly a domain name or an IP address, and may be, for example: http (s)// cell 1 or http(s): //10.10.10.10.
For each service, the positions of a plurality of characters of the unit address corresponding to the service in the service identification of the service, the corresponding relation between the key characters and the unit identification of the unit in which the service is located are stored in the storage server.
In the embodiment of the present application, the positions of a plurality of characters in a service identifier, which have a corresponding relationship with a target unit address where a target service is located, are configured in advance, where the positions of keywords in a message/parameter of a service request may be configured, so as to accurately obtain the plurality of characters according to the positions of the plurality of characters in the identifier. For example, the hierarchical relationship format: root/level1/level2.
The corresponding relationship between the key characters and the unit identifiers of the units in which the services are located can be set by the user during configuration, each key character can only correspond to one unit, or some key characters can correspond to one unit, which can be seen in tables 1 and 2. The specific corresponding rule is not limited by the scheme, and only the corresponding unit address is found according to the key character finally.
When each service is started, a unit identifier of a unit where the service is located is configured in the service, wherein the corresponding relationship between the service and the unit identifier is stored locally, the service only needs to introduce the unit identifier of the unit where the service is located when the service is started, and the unit identifier is consistent with the unit identifier in the storage server, for example, after the service a in the unit 1 is called, the service a needs to send other service calling requests to the outside, and at this time, the service a obtains the locally configured unit identifier "unit 1".
Optionally, a service name of the service is configured in the storage server, and the service name is not specifically limited, for example, http:// domain name/day/search/history, and the "day/search/history" may be configured as the service name, and the "history" may also be configured as the service name; the service path url accessed may also be configured, for example, using the part behind the browser time domain name, http:// domain name/search.do/name = xxxx, where "search.do" is the name of the service and "name = xxx" is the url parameter of the service. The configuration service name is used as a basis for the unit addressing device to intercept a service request sent by a terminal or a service request sent by a certain service, and if the service which is expected to be called is found not to be configured, the unit addressing device does not intercept or calculate the service request and only executes the service calling step of the original terminal or service.
Optionally, the format of the service identifier and a plurality of characters in the service identifier are configured, for example, the format of a message/parameter of the service request, and the format of the service identifier may be various, including but not limited to a Json format, an Xml format, a url parameter format, a header format of an http request, and the like.
In addition, each configuration item in this embodiment may be stored in any storage medium, which is not limited in this embodiment, and only the configured information needs to be read in the unit addressing method after the pre-configuration. Therefore, the embodiment of the application does not need to use a specific type of storage medium, and can avoid additional cost caused by preparation of a specific storage medium.
Referring to fig. 4, fig. 4 schematically shows a flow chart of a unit addressing method according to a complete embodiment of the present application, which may include:
s401, a terminal sends a first service request to a gateway, wherein the first service request is used for requesting to call a first target service on a unit;
s402, the unit addressing device acquires a first service request, and determines a first service identifier of a first target service in the first service request, wherein the first service identifier comprises a plurality of characters;
s403, if the first service identifier does not include a character corresponding to the first target unit address, the unit addressing device intercepts at least one character from the first service identifier as a first key character, determines a first target unit address corresponding to the first key character according to a corresponding relation between a pre-configured key character and the unit address, and sends the first target unit address and the first service request to the gateway;
s404, the gateway sends the first service request to a first target unit address so that the terminal calls a first target service;
s405, the first target service sends a second service request to the gateway, and the second service request is used for calling the second target service;
s406, the unit addressing device acquires the second service request, and determines a second service identifier of a second target service in the second service request, wherein the second service identifier comprises a plurality of characters;
s407, if the second service identifier does not include a character corresponding to the second target unit address, the unit addressing device intercepts at least one character from the second service identifier as a second key character, and determines a second target unit address and a second target unit identifier corresponding to the second key character according to a corresponding relationship between the preconfigured key character and the unit address;
s408, if the second target unit identification is the same as the unit identification of the first target service, sending a second service request to the first target service;
s409, the first target service sends a second service request to the unit address, so that the first target service calls the second target service.
S410, if the second target unit identification is different from the first target unit identification, sending a second target unit address and a second service request to the first target service; the first target unit identification is the unit identification of the unit where the first target service is located;
s411, the first target service sends the second service request to the second target unit address, so that the first target service calls the second target service.
For example, in an alternative embodiment, assume that there is a Z company located in Beijing.
If the sales condition of the Z company in Beijing in this month is required to be inquired, the sales condition comprises the customers of the Z company and the sales amount corresponding to each customer, a user operates at a terminal, and the terminal generates an inquiry service calling request which is used for calling an inquiry service to inquire the customers of the Z company and the sales amount of the customers and sending the inquiry service to a gateway;
the unit addressing device intercepts a query service request, obtains a service identifier of the service, analyzes the service identifier, obtains a plurality of characters, cuts out key characters in the characters according to a preset rule, determines that a target unit address of the request is a Beijing unit according to the corresponding relation between the key characters and the target unit address, then sends the address of the Beijing unit and a request I to the gateway, and the gateway sends the request to the Beijing unit to call a service A which has the function of querying Z company client information.
After inquiring the current customers of the Z company, the service A needs to calculate the sales amount between the Z company and all the customers, and the service A sends out a request for calling the service B, wherein the service B can collect the sales amount in the unit. And service A is configured with the unit identification of 'Beijing unit' in service A from local at the time of starting.
Assuming that a Z company sells goods only in Beijing, a unit addressing device intercepts a request for calling a service B, obtains a service identifier of the service, analyzes the service identifier to obtain a plurality of characters, cuts out key characters in the plurality of characters according to a preset rule, determines a target unit identifier of the request as a Beijing unit according to the corresponding relation between the key characters and the target unit identifier, and sends the information to the service A as the same as the unit identifier configured in the service A, and the service A only needs to be called in the unit.
Assuming that the Z company only sells goods in Shanghai, after the unit addressing device performs the operation, the unit addressing device determines that the target unit identifier of the request is 'Shanghai unit', the unit identifier is different from the unit identifier pre-configured by the service A, the unit addressing device provides the service A with the request for calling the service B and the unit address of the 'Shanghai unit', and the service A sends the request for calling the service B to the Shanghai unit for calculating and summarizing the total sale amount of the Z company in Shanghai.
The embodiment of the present application provides a unit addressing apparatus, including a first obtaining module 501, a first intercepting module 502, and a first determining module 503, where:
a first obtaining module, configured to obtain a first service request, where the first service request is used to request to invoke a first target service on a unit, and determine a first service identifier of the first target service, where the first service identifier includes multiple characters;
the first intercepting module is used for intercepting at least one character from a plurality of characters as a first key character according to a preset key character;
and the first determining module is used for determining a first target unit address corresponding to the first key character according to the corresponding relation between the pre-configured key character and the unit address, wherein the first target unit address is the address of the first target service.
The apparatus in the embodiment of the present application may execute the method provided in the embodiment of the present application, and the implementation principle is similar, the actions executed by the modules in the apparatus in the embodiments of the present application correspond to the steps in the method in the embodiments of the present application, and for the detailed functional description of the modules in the apparatus, reference may be made to the description in the corresponding method shown in the foregoing, and details are not repeated here.
As an alternative embodiment, determining the first target unit address corresponding to the first key character further includes:
and the sending module is used for sending the first target unit address and the first service request to the gateway so as to indicate the gateway to send the first service request to the first target unit address.
As an alternative embodiment, the sending the first target unit address and the first service request to the gateway further includes:
the second obtaining module is used for obtaining a second service request, the second service request is used for calling a second target service and determining a second service identifier of the second target service, and the second service identifier comprises a plurality of characters;
the second interception module is used for intercepting at least one character from the second service identifier as a second key character according to the preset key character;
and the second determining module is used for determining a second target unit address and a second target unit identifier corresponding to the second key character according to the corresponding relation between the pre-configured key character and the unit address, wherein the second target unit address is the address of the second target service.
As an optional embodiment, determining a second target unit address and a second target unit identifier corresponding to the second key character, and then:
a first judging and sending module, configured to send the second target unit address and the second service request to the first target service to indicate the first target service to perform the following operations if the second target unit identifier is different from the first target unit identifier:
and sending the second service request to a second target unit address, and calling a second target service, wherein the first target unit identifier is the unit identifier of the unit where the first target service is located.
As an optional embodiment, determining a second target unit address and a second target unit identifier corresponding to the second key character, and then:
and the second judgment sending module is used for sending a second service request to the first target service if the second target unit identifier is the same as the unit identifier of the first target service, so as to indicate the first target service to send the second service request to the first target unit address, and call the second target service.
As an alternative embodiment, intercepting at least one character from the plurality of characters as a first key character according to a preconfigured key character, further comprising:
and the character acquisition module is used for acquiring a plurality of characters from the first service identifier according to fields occupied by the plurality of pre-configured characters in the first service identifier.
As an alternative embodiment, determining a first target cell address corresponding to a first key character according to a correspondence between preconfigured key characters and cell addresses includes:
the identification determining module is used for determining a first target unit identification corresponding to the first key character according to the corresponding relation between the pre-configured key character and the unit identification;
and an address determination module. And the unit address determining unit is used for determining a first target unit address corresponding to the first target unit identifier according to the corresponding relation between the pre-configured unit identifier and the unit address.
An embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory, where the processor executes the computer program to implement the steps of the cell addressing method, and compared with the related art, the electronic device may implement: determining a first service identifier of a first target service called by a first service request by acquiring the first service request, wherein the first service request is used for requesting to call a first target service on a unit, and the first service identifier comprises a plurality of characters; intercepting at least one character from a plurality of characters as a first key character according to a preset key character, and greatly reducing the data volume needing to be stored by intercepting the plurality of characters; and determining a first target unit address corresponding to the first key character according to the corresponding relation between the pre-configured key character and the unit address, wherein the first target unit address is the address of the unit where the first target service is located. The service request is automatically transmitted to the corresponding unit, and the corresponding relation between the characters and the unit address can be stored in any storage medium, so that the economic burden is reduced on one hand, and the burden of program operation is reduced on the other hand.
In an alternative embodiment, an electronic device is provided, as shown in fig. 5, the electronic device 4000 shown in fig. 5 comprising: a processor 4001 and a memory 4003. Processor 4001 is coupled to memory 4003, such as via bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, and the transceiver 4004 may be used for data interaction between the electronic device and other electronic devices, such as transmission of data and/or reception of data. In addition, the transceiver 4004 is not limited to one in practical applications, and the structure of the electronic device 4000 is not limited to the embodiment of the present application.
The Processor 4001 may be a CPU (Central Processing Unit), a general-purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 4001 may also be a combination that performs a computational function, including, for example, a combination of one or more microprocessors, a combination of a DSP and a microprocessor, or the like.
Bus 4002 may include a path that carries information between the aforementioned components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 4002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus.
The Memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic Disc storage medium, other magnetic storage devices, or any other medium that can be used to carry or store a computer program and that can be Read by a computer, without limitation.
The memory 4003 is used for storing computer programs for executing the embodiments of the present application, and is controlled by the processor 4001 to execute. The processor 4001 is configured to execute a computer program stored in the memory 4003 to implement the steps shown in the foregoing method embodiments.
Embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, and when being executed by a processor, the computer program may implement the steps and corresponding contents of the foregoing method embodiments.
Embodiments of the present application further provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps and corresponding contents of the foregoing method embodiments may be implemented.
The terms "first," "second," "third," "fourth," "1," "2," and the like in the description and claims of this application and in the preceding drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used are interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in other sequences than illustrated or otherwise described herein.
It should be understood that, although each operation step is indicated by an arrow in the flowchart of the embodiment of the present application, the implementation order of the steps is not limited to the order indicated by the arrow. In some implementation scenarios of the embodiments of the present application, the implementation steps in the flowcharts may be performed in other sequences as desired, unless explicitly stated otherwise herein. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on an actual implementation scenario. Some or all of these sub-steps or stages may be performed at the same time, or each of these sub-steps or stages may be performed at different times, respectively. In a scenario where execution times are different, an execution sequence of the sub-steps or the phases may be flexibly configured according to requirements, which is not limited in the embodiment of the present application.
The above are only optional embodiments of partial implementation scenarios in the present application, and it should be noted that, for those skilled in the art, other similar implementation means based on the technical idea of the present application are also within the scope of protection of the embodiments of the present application without departing from the technical idea of the present application.

Claims (10)

1. A method of cell addressing, comprising:
acquiring a first service request, and determining a first service identifier of a first target service called by the first service request, wherein the first service request is used for requesting to call a first target service on a unit, and the first service identifier comprises a plurality of characters;
intercepting at least one character from the plurality of characters as a first key character according to a preset key character;
according to the corresponding relation between the key characters and the unit addresses, a first target unit address corresponding to the first key character is determined, and the first target unit address is the address of the unit where the first target service is located.
2. The method of claim 1, wherein determining the first target cell address corresponding to the first key character further comprises:
sending the first target unit address and the first service request to a gateway to instruct the gateway to send the first service request to the first target unit address.
3. The method of claim 2, wherein said issuing the first target unit address and the first service request to a gateway further comprises:
acquiring a second service request, wherein the second service request is used for calling a second target service and determining a second service identifier of the second target service, and the second service identifier comprises a plurality of characters;
intercepting at least one character from the second service identifier as a second key character according to the preconfigured key character;
and determining a second target unit address and a second target unit identifier corresponding to the second key character according to the corresponding relation between the preconfigured key character and the unit address, wherein the second target unit address is the address of the second target service.
4. The method of claim 3, wherein determining the second target cell address and the second target cell identification corresponding to the second key character further comprises:
if the second target unit identifier is not the same as the first target unit identifier, the second target unit address and the second service request are sent to the first target service to instruct the first target service to perform the following operations:
and sending the second service request to the second target unit address, and calling the second target service, wherein the first target unit identifier is the unit identifier of the unit where the first target service is located.
5. The method of claim 3, wherein determining the second target cell address and the second target cell identification corresponding to the second key character further comprises:
and if the second target unit identification is the same as the unit identification of the first target service, sending the second service request to the first target service to indicate the first target service to send the second service request to the first target unit address so as to call the second target service.
6. The method of claim 1, wherein the intercepting at least one character from the plurality of characters as a first key character according to a preconfigured key character further comprises:
and obtaining the plurality of characters from the first service identifier according to the occupied fields of the plurality of pre-configured characters in the first service identifier.
7. The method of claim 1, wherein determining the first target cell address corresponding to the first key character according to a correspondence between preconfigured key characters and cell addresses comprises:
determining a first target unit identifier corresponding to the first key character according to the corresponding relation between the pre-configured key character and the unit identifier;
and determining a first target unit address corresponding to the first target unit identifier according to the corresponding relation between the pre-configured unit identifier and the unit address.
8. A unit addressing apparatus, comprising:
a first obtaining module, configured to obtain a first service request, where the first service request is used to request to invoke a first target service on a unit, and determine a first service identifier of the first target service, where the first service identifier includes a plurality of characters;
the first intercepting module is used for intercepting at least one character from the plurality of characters as a first key character according to a preset key character;
a first determining module, configured to determine, according to a correspondence between a preconfigured key character and a unit address, a first target unit address corresponding to the first key character, where the first target unit address is an address of the first target service.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory, characterized in that the processor executes the computer program to implement the steps of the method of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202210887587.7A 2022-07-26 2022-07-26 Unit addressing method and device and electronic equipment Active CN115374023B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210887587.7A CN115374023B (en) 2022-07-26 2022-07-26 Unit addressing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210887587.7A CN115374023B (en) 2022-07-26 2022-07-26 Unit addressing method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN115374023A true CN115374023A (en) 2022-11-22
CN115374023B CN115374023B (en) 2023-06-16

Family

ID=84063506

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210887587.7A Active CN115374023B (en) 2022-07-26 2022-07-26 Unit addressing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN115374023B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109151025A (en) * 2018-08-22 2019-01-04 京信通信系统(中国)有限公司 Load-balancing method, device, computer storage medium and equipment based on URL
US20200351243A1 (en) * 2018-03-13 2020-11-05 Huawei Technologies Co., Ltd. Method and apparatus for transmitting application programming interface api request
CN112491717A (en) * 2019-09-12 2021-03-12 华为技术有限公司 Service routing method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200351243A1 (en) * 2018-03-13 2020-11-05 Huawei Technologies Co., Ltd. Method and apparatus for transmitting application programming interface api request
CN109151025A (en) * 2018-08-22 2019-01-04 京信通信系统(中国)有限公司 Load-balancing method, device, computer storage medium and equipment based on URL
CN112491717A (en) * 2019-09-12 2021-03-12 华为技术有限公司 Service routing method and device

Also Published As

Publication number Publication date
CN115374023B (en) 2023-06-16

Similar Documents

Publication Publication Date Title
CN107798038B (en) Data response method and data response equipment
CN110601880B (en) Cloud platform, service processing method, command interface and computer equipment
CN106202096A (en) Customer terminal webpage rendering intent and device
CN110019080B (en) Data access method and device
CN113364853B (en) Business service system, business request method and gateway equipment
CN108279987A (en) The method for edition management and device of application program
CN105095423B (en) Enumeration data wiring method and device
CN109213758B (en) Data access method, device, equipment and computer readable storage medium
CN109871289A (en) A kind of remote procedure call service creation method and device
CN111708589A (en) Information processing system, method, device and readable storage medium
CN112579898A (en) Enterprise information management method and device and server
CN111381820A (en) Method and device for automatically generating API based on GUI
CN114416075A (en) Service processing method and device
CN111881329A (en) Account balance management method and system
CN111639119A (en) Customer information query method and equipment in anti-money laundering system
CN108282455A (en) Web-page requests method, apparatus and domain-name information analysis result processing method, device
CN114185973A (en) Parameter calling method, device, equipment and computer readable storage medium
CN114675982A (en) General method and system for acquiring data of service integration system
CN115374023B (en) Unit addressing method and device and electronic equipment
CN115456739B (en) Data management method and related device
CN111767481A (en) Access processing method, device, equipment and storage medium
CN109561048B (en) Communication management method and device
CN112491943A (en) Data request method, device, storage medium and electronic equipment
CN111464574B (en) Calling, loading, registering and managing method and route, server, node and medium
CN105117932A (en) Marketing system

Legal Events

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