CN114157565A - System and method for supporting privatized deployment - Google Patents

System and method for supporting privatized deployment Download PDF

Info

Publication number
CN114157565A
CN114157565A CN202210117034.3A CN202210117034A CN114157565A CN 114157565 A CN114157565 A CN 114157565A CN 202210117034 A CN202210117034 A CN 202210117034A CN 114157565 A CN114157565 A CN 114157565A
Authority
CN
China
Prior art keywords
server
data
user
application program
session
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
CN202210117034.3A
Other languages
Chinese (zh)
Other versions
CN114157565B (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.)
Nanjing Mangkeke Information Technology Co ltd
Original Assignee
Nanjing Mangkeke Information Technology 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 Nanjing Mangkeke Information Technology Co ltd filed Critical Nanjing Mangkeke Information Technology Co ltd
Priority to CN202210117034.3A priority Critical patent/CN114157565B/en
Publication of CN114157565A publication Critical patent/CN114157565A/en
Application granted granted Critical
Publication of CN114157565B publication Critical patent/CN114157565B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • 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/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a system and a method for supporting privatized deployment, wherein the system comprises a server, a front-end toolkit and a front-end toolkit plug-in, and the method comprises the following steps: s1, providing an application program interface through the server, and connecting the javascript to the server by using a network protocol; s2, using network protocol, user sends data packet to service end through application program interface; and S3, the server receives the data packet sent by the user through the application program interface, analyzes and identifies the object in the json format, carries out serialization and deserialization, and modifies and adjusts the data structure of the object in the json format by using deep recursion according to the path of the user. The invention can lead the research and development company authorized to use the invention to flexibly use the server thereof, and does not forcibly bind the user to use the technical system in the SaaS mode for paying.

Description

System and method for supporting privatized deployment
Technical Field
The invention relates to the technical field of internet, in particular to a system and a method for supporting privatized deployment.
Background
With the rapid development of the internet, the functions of internet applications are gradually enriched, the interface complexity is increased, the traditional website architecture adopts a single application architecture, front-end codes and back-end codes are located in a code library, the MVC mode is used for embedding the back-end codes into a front-end template, and a front-end page is generated by the back end according to the template during each visit. In this mode, the front-end function is single, the interactivity is not strong, and the developer does not clearly distinguish the concept of the front end and the back end, so that the development and maintenance cost can be rapidly increased after the system scale is gradually increased; therefore, the industry proposes a front-end and back-end separated development mode, the front end is independent, the AJAX technology is used for dynamically requesting data from the back end, and under the condition of appointing a front-end and back-end interface, a front-end developer can independently iterate a front-end terminal system without paying attention to the realization of the back end, so that decoupling is realized.
By using the micro-service, a developer can quickly complete construction and deployment, the maintenance cost is greatly reduced, and the scalability is also obviously improved compared with that of a single program, but the micro-service still does not get rid of a client-server model in essence, a user needs to build a runtime environment under the model, then the service is deployed on pre-allocated cloud Computing resources, and server-free Computing (Serverless Computing) is a new paradigm of cloud Computing.
At present, the service end of the internet still has the following technical defects:
1. the development, operation and maintenance of the back-end service are difficult, and engineers are difficult to bring;
2. the real-time data transmission is required, but the research and development cost and difficulty are high;
3. although the front end and the rear end are separated in the traditional development, the development matching requirement is high, codes are required to be simultaneously debugged, and the problems of the front end and the rear end or the front end such as the rear end always occur;
4. although nodjs aims at gathering the front end and the back end and enabling the front end and the back end to write codes by using javascript, the nodjs aims at solving the problem that the front end and the back end need to be compiled and are not light enough, and an NPM development environment is needed.
An effective solution to the problems in the related art has not been proposed yet.
Disclosure of Invention
The present invention provides a system and a method for supporting privatized deployment, which are directed to the problems in the related art, so as to overcome the above technical problems in the related art.
Therefore, the invention adopts the following specific technical scheme:
according to an aspect of the present invention, there is provided a system for supporting privatized deployment, including: the system comprises a server, a front-end toolkit and a front-end toolkit plug-in;
the server is used for receiving a data packet sent by a user through an application program interface, analyzing and identifying an object in a json format, carrying out serialization and deserialization, modifying and adjusting a data structure of the object in the json format by using a deep recursion according to a path of the user, judging the storage type of the path after processing a data node, storing data into a memory of the server, reading data of the path monitored in the session of the current user from the memory, and carrying out a broadcasting action of a network protocol on the user;
the front-end toolkit is used for providing an application program interface, connecting the javascript to a server by using a network protocol, sending a data packet to the server by using the application program interface through the network protocol, calling a memory of a browser to directly execute callback, realizing real-time data callback, executing an operation instruction by using an application program interface of once for common query, acquiring a value of the node from the browser after the server identifies, and performing independent session broadcast;
the front-end toolkit plug-in is used for packaging an original front-end toolkit, supporting the execution of a client toolkit in the NPM environment of node.JS, and sending an instruction to a server to perform data persistence operation, acquisition and monitoring actions.
Further, the providing of the application program interface and the connecting of the javascript to the server by using the network protocol include the following steps:
the connection of a privately deployed server is quickly realized by calling a line of application program interface commands;
the program automatically calls the node path controller through the JS-SDK of the server;
the node path controller identifies and analyzes the request and the data to generate a serialized character string, and analyzes the serialized character string by using the SDK;
analyzing the serialized character string to generate a corresponding serialized JSON character string;
and sending the network protocol to the server through a browser H5 standard interface.
Further, the utilizing the network protocol includes: the method comprises the steps of operating instructions, operating paths, operating data and callback functions.
Further, the receiving a data packet sent by a user through an application program interface, analyzing and identifying an object in a json format, performing serialization and deserialization, and performing data structure modification and adjustment on the object in the json format by using deep recursion according to a path of the user includes the following steps:
the long connection between the server and the browser client is realized through the handshake between the server and the browser, and when the browser client is sent to the server through the JS-SDK without a service system, the server can perform primary data receiving entry processing through the message processor;
the method comprises the steps that a message character string transmitted by a long connection of a network protocol is preferentially acquired in a message processor, and deserialization operation is carried out to obtain a JSON object;
acquiring a session Id and a websocket _ session of a client from a session, and identifying a user session id and sub-session ids of a plurality of clients, which are requested to be monitored by each session;
the system identifies the behavior action communicated from the client and performs corresponding operation according to different actions.
Further, the operations include querying, monitoring, updating, adding and deleting.
Further, the memory for storing the data to the server includes three storage modes, namely memory storage, redis cache storage and MongoDB storage.
Further, the reading data of the path in the session of the current user from the memory, and performing the network protocol broadcast action on the user further includes the following steps: the server judges the request behavior of the user and stores the data persistently.
Further, the step of judging the request behavior of the user and performing persistent storage on the data by the server side comprises the following steps:
a user requests to update data node data;
and the server side automatically constructs a return message body after receiving the command and processing the data to the database for persistence.
Further, the step of calling the memory of the browser to directly execute the callback, and the step of realizing the callback of the real-time data further comprises the following steps: the server side pushes the message by a core message pushing method of the core package, and the pushing comprises an accurate user session id and a response of the packaged message;
wherein the response after encapsulation comprises callback Id, code and value.
According to another aspect of the present invention, there is provided a method of supporting privatized deployment, the method comprising the steps of:
s1, providing an application program interface through the server, and connecting the javascript to the server by using a network protocol;
s2, using network protocol, user sends data packet to service end through application program interface;
s3, the server receives the data packet sent by the user through the application program interface, analyzes and identifies the object in the json format, carries out serialization and deserialization, and carries out data structure modification and adjustment on the object in the json format by using deep recursion according to the path of the user;
s4, processing the node of the data by using the server, judging the storage type of the path, and storing the data into the memory of the server;
s5, the server side reads data of a path monitored in the session of the current user from the memory, performs a broadcasting action of a network protocol on the user, and calls the memory of the browser to directly execute callback, so as to realize callback of real-time data;
and S6, for the common query, executing an operation instruction by using an once application program interface, identifying by a server, acquiring the value of the node from the browser, and broadcasting an individual session.
The invention has the beneficial effects that:
1. the invention can enable an Internet research and development personnel to rapidly develop a large Internet software project program by using only one basic language (javascript), and the development personnel can achieve the development capability of storing the service data in real time without writing a back-end program code.
2. The invention solves the technical threshold problem of the system, establishes an extremely low technical threshold, has a complete set of API of front-end javascript language, can enable research and development personnel to use a MonkeyKey system to complete the compiling of business logic under the scene required by each business development, and the development personnel do not need to care about the technical problems in various aspects such as storage, reading, performance and the like of a back-end database (no threshold is developed), and the technology of the invention is suitable for all web applications (no threshold is used) of the internet.
3. By the system, research and development technicians can reduce research and development labor cost by 30% and shorten development period by 50% after using the system, and a substantial development leap is created for research and development companies; the invention can be deployed privately, can enable a research and development company authorized to use the invention to flexibly use the server of the research and development company, and does not forcibly bind users to use the technical system for paying by using the SaaS mode.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a schematic structural diagram of a system supporting privatized deployment according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a system supporting privatized deployment according to an embodiment of the present invention
FIG. 3 is a diagram of a real-time multiplayer online game using MonkeyKey to develop high performance in a method for supporting privatized deployment, according to an embodiment of the present invention;
fig. 4 is a flow chart of a method of supporting privatized deployment according to an embodiment of the present invention.
Detailed Description
For further explanation of the various embodiments, the drawings which form a part of the disclosure and which are incorporated in and constitute a part of this specification, illustrate embodiments and, together with the description, serve to explain the principles of operation of the embodiments, and to enable others of ordinary skill in the art to understand the various embodiments and advantages of the invention, and, by reference to these figures, reference is made to the accompanying drawings, which are not to scale and wherein like reference numerals generally refer to like elements.
According to the embodiment of the invention, a system and a method for supporting privatized deployment are provided.
Referring now to the drawings and the detailed description, in which like reference numerals refer to like elements throughout, a system for supporting privatized deployment according to an embodiment of the present invention includes: the system comprises a server, a front-end toolkit and a front-end toolkit plug-in;
the server is used for receiving a data packet sent by a user through an application program interface, analyzing and identifying an object in a json format, carrying out serialization and deserialization, modifying and adjusting a data structure of the object in the json format by using a deep recursion according to a path of the user, judging the storage type of the path after processing a data node, storing data into a memory of the server, reading data of the path monitored in the session of the current user from the memory, and carrying out a broadcasting action of a network protocol on the user;
the front-end toolkit is used for providing an application program interface, connecting a javascript (a basic language) to a server by using a network protocol (websocket), sending a data packet to the server by using the application program interface through the network protocol, calling a memory of a browser to directly execute a callback, realizing callback of real-time data, executing an operation instruction by using an application program interface of an once for ordinary query, acquiring a value of a node from the browser after the server identifies the node, and performing independent session broadcast;
the front-end toolkit plug-in is used for packaging an original front-end toolkit, supporting the execution of a client toolkit in the NPM environment of node.JS, and sending an instruction to a server to perform data persistence operation, acquisition and monitoring actions.
For the convenience of understanding the above technical solution of the present invention, the functions and principles of the above system components of the present invention will be described in detail below.
Monkey key-Server (Server): and the service end of the MonkeyKey receives the instruction from the client end and performs the persistent operation of the database and the broadcast capability of the client end. The service end is used for communicating with the client end using the SDK, supports building websocket long connection handshake and communication with the client end, supports receiving operation paths, request data and operation instructions requested by the SDK to add, delete, change, search and monitor the appointed MongoDB database node, and broadcasts the latest data under the corresponding path to the monitor from the client end all over the world in real time through the websocket. The Server supports privatized deployment, a client can deploy the Server to the Server of the client, and the address configuration of the Server of the client SDK is adjusted, so that the front end can be connected to the privatized deployed monkey Server in real time through the SDK. Developers only need to deploy the server, and can define and communicate the server interface through the client SDK without writing the server code, so the system is called a serverless technical system;
JavaScript-SDK (front end toolkit): the client side SDK of the monkey Key is specially provided for the SDK of the javascript language used by a front-end developer, and provides rich API instruction javascript functions, so that a developer can realize the creation and data maintenance operation of a target database only by writing javascript, and the SDK can be automatically connected to an monkey Key Server and is used for instruction analysis and database persistence operation by the Server;
NodeJS-SDK (front end toolkit plug-in): the node.JS end SDK of the MonkeyKey has the same function as the JavaScript SDK, encapsulates the original JavaScript SDK, and supports the execution of the client side SDK in the NPM environment of the node.JS, thereby realizing the actions of sending an instruction to the MonkeyKey Server for data persistence operation, acquisition, monitoring and the like.
In one embodiment, connecting the javascript to the server by using a network protocol comprises the following steps:
by calling a line of application program interface commands, the connection of the privately deployed server side is quickly realized, and the codes are as follows:
var ref = monkey. // specifying a storage Path
Set (value); storing data into the designated path;
the program automatically calls the node path controller through JS-SDK of the server, and the code is as follows:
function nodePathController(nodePath, sessionId, type, jsonStr);
the node path controller identifies and analyzes the request and the data to generate a serialized character string, and analyzes the serialized character string by using the SDK;
in specific application, in order to accurately generate the serialized character string of the correct data type, the SDK preferentially analyzes whether the incoming jsonStr is of the character string type or the numerical type, and the following analysis is performed
if (typeof jsonStr == 'string') {
try {
JSON.parse(jsonStr);
} catch (e) {
isStr = true;
};
}
if (typeof (jsonStr*1) == "number" && (jsonStr*1) < 0.000001 && ((jsonStr*1) != 0)) {
isStr = true;
}
And after the serialized character strings are analyzed, generating corresponding serialized JSON character strings, wherein the codes are as follows:
var _msg = "{\"code\":\"MKK_" + _type + "\",\"nodePath\":\"" + _nodePath + "\",\"sessionId\":\"" + _sessionId + "\","
+ eval('(jsonStr != null ' + decodeURIComponent("%3F") + ' \"\\"data\\":\" + (isStr ' + decodeURIComponent("%3F") + ' \"\\"\" + jsonStr + \"\\"\" : jsonStr) : \"\\"data\\": null\")') + ",\"db\":\"" + window.config.db
+ "\",\"collection\":\"" + window.config.collection + "\"}";
the network protocol is sent to the server side through a browser H5 standard interface, and the codes are as follows:
if(sock.readyState === 1){
sock.send(_msg);
} else {
setTimeout(function(){
nodePathController(_nodePath, _sessionId, _type, _jsonStr);
}, 200);
}。
specifically, the network protocol includes: an operation instruction, an operation path (database, collection, path), operation data (data), and a callback function (callback function).
In one embodiment, the receiving a data packet sent by a user through an application program interface, analyzing and identifying an object in a json format, performing serialization and deserialization, and performing data structure modification and adjustment on the object in the json format by using deep recursion according to a path of the user includes the following steps:
the long connection between the server and the browser client is realized through the handshake between the server and the browser, when the browser client sends the browser client to the server through the JS-SDK without a service system, the server can perform primary data receiving entry processing through the message processor, and the core packet name of the server is as follows: com, monkey, handle, websocket handler, the core methodology is described as follows:
public void handleMessage(WebSocketSession session, WebSocketMessage<> webSocketMessage) throws Exception;
the method comprises the steps that a message character string transmitted by a long connection of a network protocol is preferentially acquired in a message processor, and deserialization operation is carried out to obtain a JSON object (JSONObject);
synchronized (this) {
String response = "";
String msg = webSocketMessage.getPayload() + "";
msg = msg.replaceAll("\\n", "\\${MKK_NEXT_LINE}");
JSONObject json = JSONObject.parseObject(msg);
....
};
acquiring a session Id and a websocket _ session of a client from a session, and identifying a user session id (userName) and sub-session ids (session Id) of a plurality of clients, which are requested to be monitored by each session;
JSONObject json = JSONObject.parseObject(msg);
String sessionId = json.get("sessionId") + "";
// this userName is just JSESSIONID
userName = (String) session.getAttributes().get("WEBSOCKET_SESSIONID");
String code = json.get("code") + "";
// this sessionId is JSSOSIONID + UUID or JSSOSIONID + TimeStamp
String nodePath = json.get("nodePath") + "";
String fullPath = json.get("nodePath") + "";
The system identifies the behavior action communicated from the client and performs corresponding operation according to different actions, and the code is as follows:
switch (code) {
case "MKK_ON":
......
// store in cache
nodePathAndUsers.put(fullPath.replace(filter, ""), userList);
......
case "MKK_OFF":
......
// store in cache
nodePathAndUsers.put(fullPath, userList);
......
break;
case "MKK_ONCE":
......
Object res = SmartUtil.baseOnce(nodePath, db, collection);
......
break;
case "MKK_PUSH":
......
Object res = SmartUtil.basePush(nodePath, db, collection, obj);
......
break;
case "MKK_SET":
......
V/push directly, without logging into the database
if (fullPath.equals("codeworld/test/xy")) {
V/real-time communication broadcast
SmartUtil.websocketToUsers(fullPath, obj, "", db, collection);
......
} else {
Object res = SmartUtil.baseSet(nodePath, db, collection, obj);
......
}
......
break;
case "MKK_UPDATE":
......
Object res = SmartUtil.baseUpdate(nodePath, db, collection, obj);
......
break;
default:
// other Instructions not open for the moment
if (!"".equals(response)) {
response = response
} else {
response = "{\"code\": \"ERROR\", \"value\": \"This code: " + code + " is not defined.\"}";
}
break;
}。
Specifically, the operations include querying, monitoring, updating, adding, and deleting. The memory for storing the data to the server side comprises three storage modes of memory storage, redis cache storage and MongoDB storage, and the core package is positioned in the server side package;
in specific application,// if redis mode
if (RedisCluster.isRedisMode(db + "/" + col + "->" + path.replaceAll("\\.", "\\/"))) {
// store in redis
saveRedis(path.replaceAll("\\.", "\\/"), db, col, json);
} else {
// store in MongoDB
......
collection.insertOne(addDoc);
......
collection.updateOne(filterBson, doc);
......
}。
In an embodiment, the reading, from the memory, data of a path monitored in the session of the current user, and performing a network protocol broadcast action on the user further includes the following steps: the server judges the request behavior of the user and performs persistent storage on the data, and the method specifically comprises the following steps:
after the server determines the request behavior of the user, persistent storage is performed on the data, for example, the user requests a SET (updated data node data), and after the server receives a command and processes the data, and persists the data in the database, the server will construct a response (returned message body) by itself, where the code is as follows:
case "MKK_SET":
......
Object res = SmartUtil.baseSet(nodePath, db, collection, obj);
if (res instanceof String && !MongoUtil.isJsonStr(res)) {
res = "\"" + res + "\"";
}
response = "{\"callbackId\":\"" + sessionId + "\",\"code\": \"CALLBACK\", \"value\": " + res +
", \"nodePath\": \"" + fullPath + "\"}";
......
Break。
in an embodiment, the invoking the memory of the browser directly executes callback, and the implementing the callback of the real-time data further includes the following steps: the server side pushes the message through a core message pushing method of the core packet, the pushing includes an accurate user session ID (identity) and an encapsulated response, the response includes a CALLBACK ID (i.e. a sessionId client-unique CALLBACK ID for informing the client side which CALLBACK function should be called after receiving the message), a code (the server side informs the client side of an action to be executed by the client side in the message notification, the action is called CALLBACK, i.e. CALLBACK function trigger), and a value (a value returned by the server side after a request from the client side, a value of a newest node, which is equal to a return of a node data query), and the calling function is as follows:
sendMessageToUser(userName, new TextMessage(response));
for the ordinary query, the execution of the operation instruction is performed by using an once application program interface, the value of the node is obtained from the browser after the server is identified, and a code for performing an individual session broadcast is as follows:
case "MKK_ONCE":
if (json.get("nodePath") != null) {
Object res = SmartUtil.baseOnce(nodePath, db, collection);
......
response = "{\"callbackId\":\"" + sessionId + "\",\"code\": \"CALLBACK\", \"value\": " + res +
", \"nodePath\": \"" + fullPath + "\"}";
}
else {
response = "{\"code\": \"ERROR\", \"value\": \"NodePath is null.\"}";
}
break;
......
sendMessageToUser(userName, new TextMessage(response))。
in a specific application, according to another specific embodiment of the present invention, the system for supporting privatized deployment further includes a product side, and the specific usage flow is as follows:
the serverless system has no front-end form, developers directly introduce the serverless system through the html head, and service codes are as follows:
<script src="monkeykey-1.0.0.js"></script>;
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible">
<link rel="shortcut icon" href="/favicon.ico">
<link rel="bookmark" href="/favicon.ico" type="image/x-icon">
<title>MonkeyKey.io</title>
<link rel="stylesheet" href="css/style.css">
<script src="monkeykey-1.0.0.js"></script>
</head>。
the new monkey key can be directly used to obtain monkey key master objects, after a data node path expected to be operated is appointed, arbitrary API of the monkey key can be used to carry out operations of adding, deleting, changing and searching on the data of the system, and the codes are as follows:
// specify Monkey Key Server (developers can specify their own servers after private deployment)
window.config.syncURL = 'https://' + window.monkey.server;
V/database to store specified Monkey Key
window.config.db = 'monkey';
// specifying the Container in the database where the Monkey Key is to be stored
window.config.collection = 'team';
V/initialize Monkey Key and name MKK _ APP to the current application
window.app = monkeykey.initializeApp(config, "MKK_APP");
V/specify the node path to be operated on: codeworld/test/times
window.ref = window.app.sync().ref().root().ref("codeworld/test/times");
function doIt(){
V/node real-time monitoring (equivalent to real-time query for long connections, which automatically executes internal callback functions in case of change of the node)
window.ref.on(function(d){
Acquiring the latest value of the node broadcast in real time
if (d.val() != null) {
Simple business logic judgment (judgment whether automatic refresh or current page manual trigger)
if (!window.hasRecord) {
// setting of nodes (i.e. updating of node data values, supporting all data types
// after the js code of the row is executed, all users of the current page around the world will automatically refresh)
window.hasRecord = true;
ref.set(d.val() + 1);
};
// number from 0 to present in 1 second
// global user sharing real-time data refresh effect
var c = 0;
var code = setInterval(function(){
c++;
if (c > 100) {
clearInterval(code);
} else {
Val () latest value of current node
$("#times").html(Math.ceil(d.val() * (c/100)));
};
}, 10);
};
});
};
doIt();
After a developer designates a certain data node path, the developer can monitor data by using on in the API, and the developer can complete a real-time chat system by using 3 lines of codes, so that a global data synchronous refreshing numerical value can be easily obtained in real time;
developers can rapidly develop high-performance real-time multiplayer online games (as shown in figure 3), large interactive systems and the like by using MonkeyKey on any H5-supporting platform (WeChat applet, public number, android, IOS).
In order to better understand the above technical solution of the present invention, a specific embodiment of the present invention is described below:
suppose that: one company has 3 research and development personnel (2 front ends and 1 back end), one project needs 3 development time for 2 days, and the cost is 6 days;
companies using the invention: only 2 research and development personnel (2 front-end, labor cost-30%) are needed, the development can be completed in 1 day (development cycle-50%) of the project, and the cost is 2 days;
the effect is as follows: the cost of development of this project is reduced by 66% for this company.
In accordance with another embodiment of the present invention, as shown in fig. 4, there is provided a method for supporting privatized deployment, the method comprising the steps of:
s1, providing an application program interface through the server, and connecting the javascript to the server by using a network protocol;
s2, using network protocol, user sends data packet to service end through application program interface;
s3, the server receives the data packet sent by the user through the application program interface, analyzes and identifies the object in the json format, carries out serialization and deserialization, and carries out data structure modification and adjustment on the object in the json format by using deep recursion according to the path of the user;
s4, processing the node of the data by using the server, judging the storage type of the path, and storing the data into the memory of the server;
s5, the server side reads data of a path monitored in the session of the current user from the memory, performs a broadcasting action of a network protocol on the user, and calls the memory of the browser to directly execute callback, so as to realize callback of real-time data;
and S6, for the common query, executing an operation instruction by using an once application program interface, identifying by a server, acquiring the value of the node from the browser, and broadcasting an individual session.
In summary, according to the technical solutions of the present invention, the mobile application, the game or the intelligent hardware can be developed without writing a back-end code, renting a server, or operating and maintaining, so that data among devices can be pushed in real time and across multiple platforms can be realized quickly. The MonkeyKey supports privatized deployment of the MonkeyKey and can not be called only through public internet service, the MonkeyKey comprises a MonkeyKey client SDK and a MonkeyKey Server Server, and a Server supports private deployment to a local Server of a user, so that the problems of Server limitation and operation and maintenance limitation are thoroughly solved, and the MonkeyKey can be used for self-determining deployment in a cloud or a local entity Server. At present, H5 already meets the problem of cross-platform of the whole Internet, MonkeyKey provides JavaScript-SDK and then can have the characteristic of cross-platform use, in addition, MonkeyKey also provides NodeJS-SDK, NodeJS solves the problem of cross-platform to the maximum extent, thus the cross-platform capability of MonkeyKey is greatly improved; because the MonkeyKey solves the problem of data interface service, a front-end developer can easily use the JS-SDK of the MonkeyKey to realize the self-definition and calling of the data interface service, and the idea of leaning to the big front end is maximized by matching with the provision of the MonkeyKey NodeJS-SDK. For the low threshold, the JS-SDK of the MonkeyKey is developed by using native JavaScript, and no technical threshold requirement exists, so that the characteristics of a large front-end low threshold are met, the SDK has a strong function, and WebSocket and Http Long Polling are supported. There are Javascript, NodeJS sets of SDK. The system supports an offline use function, supports an offline reconnection mechanism, provides a cloud computing expression, is strong in compatibility, can quickly migrate applications, is open in data, can quickly import and export data, provides a complete user mechanism, supports third-party login, can customize an end user authorization mode, has special support for application of the Internet of things, is efficient, stable and power-saving, and is almost completely isolated in a production environment;
according to the invention, an Internet research and development personnel can quickly develop a large Internet software project program by using only one basic language (javascript), and the development capability of storing business data in real time can be achieved without writing a back-end program code by the development personnel; the invention solves the technical threshold problem of the system, establishes an extremely low technical threshold, has a complete set of API of front-end javascript language, can enable research and development personnel to use a MonkeyKey system to finish the compiling of business logic under the scene required by each business development, and the development personnel do not need to care about the technical problems in various aspects such as storage, reading, performance and the like of a back-end database (no threshold is developed), and the technology of the invention is suitable for all web applications of the internet (no threshold is used); by the system, research and development technicians can reduce research and development labor cost by 30% and shorten development period by 50% after using the system, and a substantial development leap is created for research and development companies; the invention can be deployed privately, can enable a research and development company authorized to use the invention to flexibly use the server of the research and development company, and does not forcibly bind users to use the technical system for paying by using the SaaS mode.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (10)

1. A system for supporting privatized deployment, comprising: the system comprises a server, a front-end toolkit and a front-end toolkit plug-in;
the server is used for receiving a data packet sent by a user through an application program interface, analyzing and identifying an object in a json format, carrying out serialization and deserialization, modifying and adjusting a data structure of the object in the json format by using a deep recursion according to a path of the user, judging the storage type of the path after processing a data node, storing data into a memory of the server, reading data of the path monitored in the session of the current user from the memory, and carrying out a broadcasting action of a network protocol on the user;
the front-end toolkit is used for providing an application program interface, connecting the javascript to a server by using a network protocol, sending a data packet to the server by using the application program interface through the network protocol, calling a memory of a browser to directly execute callback, realizing real-time data callback, executing an operation instruction by using an application program interface of once for common query, acquiring a value of the node from the browser after the server identifies, and performing independent session broadcast;
the front-end toolkit plug-in is used for packaging an original front-end toolkit, supporting the execution of a client toolkit in the NPM environment of node.JS, and sending an instruction to a server to perform data persistence operation, acquisition and monitoring actions.
2. The system of claim 1, wherein the providing an application program interface to connect javascript to a server using a network protocol comprises:
the connection of a privately deployed server is quickly realized by calling a line of application program interface commands;
the program automatically calls the node path controller through the JS-SDK of the server;
the node path controller identifies and analyzes the request and the data to generate a serialized character string, and analyzes the serialized character string by using the SDK;
analyzing the serialized character string to generate a corresponding serialized JSON character string;
and sending the network protocol to the server through a browser H5 standard interface.
3. The system for supporting privatized deployment according to claim 1, wherein the utilizing the network protocol comprises: the method comprises the steps of operating instructions, operating paths, operating data and callback functions.
4. The system of claim 1, wherein the receiving the data packet sent by the user through the application program interface, parsing and identifying the json-formatted object, performing serialization and deserialization, and performing data structure modification and adjustment on the json-formatted object using deep recursion according to the path of the user comprises:
the long connection between the server and the browser client is realized through the handshake between the server and the browser, and when the browser client is sent to the server through the JS-SDK without a service system, the server can perform primary data receiving entry processing through the message processor;
the method comprises the steps that a message character string transmitted by a long connection of a network protocol is preferentially acquired in a message processor, and deserialization operation is carried out to obtain a JSON object;
acquiring a session Id and a websocket _ session of a client from a session, and identifying a user session id and sub-session ids of a plurality of clients, which are requested to be monitored by each session;
the system identifies the behavior action communicated from the client and performs corresponding operation according to different actions.
5. The system of claim 4, wherein the operations comprise querying, listening, updating, adding, and deleting.
6. The system for supporting privatized deployment according to claim 1, wherein the memory for storing data to the server includes three storage modes, i.e., memory storage, redis cache storage, and MongoDB storage.
7. The system according to claim 1, wherein the reading, from the memory, data of a path monitored in the session of the current user and the broadcasting of the network protocol to the user further comprises: the server judges the request behavior of the user and stores the data persistently.
8. The system for supporting privatized deployment according to claim 7, wherein the server determines the request behavior of the user, and persistently stores the data, comprising the steps of:
a user requests to update data node data;
and the server side automatically constructs a return message body after receiving the command and processing the data to the database for persistence.
9. The system according to claim 1, wherein the memory of the calling browser directly executes callback, and the callback for real-time data further comprises the following steps: the server side pushes the message by a core message pushing method of the core package, and the pushing comprises an accurate user session id and a response of the packaged message;
wherein the response after encapsulation comprises callback Id, code and value.
10. A method for supporting privatized deployment, for implementing the system for supporting privatized deployment described in claim 1, the method comprising the steps of:
s1, providing an application program interface through the server, and connecting the javascript to the server by using a network protocol;
s2, using network protocol, user sends data packet to service end through application program interface;
s3, the server receives the data packet sent by the user through the application program interface, analyzes and identifies the object in the json format, carries out serialization and deserialization, and carries out data structure modification and adjustment on the object in the json format by using deep recursion according to the path of the user;
s4, processing the node of the data by using the server, judging the storage type of the path, and storing the data into the memory of the server;
s5, the server side reads data of a path monitored in the session of the current user from the memory, performs a broadcasting action of a network protocol on the user, and calls the memory of the browser to directly execute callback, so as to realize callback of real-time data;
and S6, for the common query, executing an operation instruction by using an once application program interface, identifying by a server, acquiring the value of the node from the browser, and broadcasting an individual session.
CN202210117034.3A 2022-02-08 2022-02-08 System and method for supporting privatized deployment Active CN114157565B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210117034.3A CN114157565B (en) 2022-02-08 2022-02-08 System and method for supporting privatized deployment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210117034.3A CN114157565B (en) 2022-02-08 2022-02-08 System and method for supporting privatized deployment

Publications (2)

Publication Number Publication Date
CN114157565A true CN114157565A (en) 2022-03-08
CN114157565B CN114157565B (en) 2022-04-22

Family

ID=80450216

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210117034.3A Active CN114157565B (en) 2022-02-08 2022-02-08 System and method for supporting privatized deployment

Country Status (1)

Country Link
CN (1) CN114157565B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102292955A (en) * 2008-11-25 2011-12-21 思杰系统有限公司 Systems and methods for load balancing real time streaming protocol
US20130246944A1 (en) * 2012-03-19 2013-09-19 Mohan Kumar Pandiyan Systems and methods for providing user interfaces for management applications
CN104662516A (en) * 2012-07-27 2015-05-27 谷歌公司 Messaging between web applications
US20160259509A1 (en) * 2015-03-02 2016-09-08 Warhead, Inc. Backend-to-frontend website development
US20170085609A1 (en) * 2015-09-23 2017-03-23 Cc Media Network Limited Extending a web browser's application program interface through native code
CN206479986U (en) * 2017-01-18 2017-09-08 深圳市雨云科技有限公司 Data access system
CN112235285A (en) * 2020-10-12 2021-01-15 山东健康医疗大数据有限公司 Method and system for user authentication mode and service based on non-session
CN113746719A (en) * 2020-05-29 2021-12-03 腾讯科技(深圳)有限公司 Task information processing method and device, electronic equipment and storage medium
CN113938886A (en) * 2021-11-30 2022-01-14 上海派拉软件股份有限公司 Identity authentication platform test method, device, equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102292955A (en) * 2008-11-25 2011-12-21 思杰系统有限公司 Systems and methods for load balancing real time streaming protocol
US20130246944A1 (en) * 2012-03-19 2013-09-19 Mohan Kumar Pandiyan Systems and methods for providing user interfaces for management applications
CN104662516A (en) * 2012-07-27 2015-05-27 谷歌公司 Messaging between web applications
US20160259509A1 (en) * 2015-03-02 2016-09-08 Warhead, Inc. Backend-to-frontend website development
US20170085609A1 (en) * 2015-09-23 2017-03-23 Cc Media Network Limited Extending a web browser's application program interface through native code
CN206479986U (en) * 2017-01-18 2017-09-08 深圳市雨云科技有限公司 Data access system
CN113746719A (en) * 2020-05-29 2021-12-03 腾讯科技(深圳)有限公司 Task information processing method and device, electronic equipment and storage medium
CN112235285A (en) * 2020-10-12 2021-01-15 山东健康医疗大数据有限公司 Method and system for user authentication mode and service based on non-session
CN113938886A (en) * 2021-11-30 2022-01-14 上海派拉软件股份有限公司 Identity authentication platform test method, device, equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
KOSAKU KIMURA,ATSUJI SEKIGUCHI: "A JavaScript Transpiler for Escaping from Complicated Usage of Cloud Services and APIs", 《2018 25TH APSEC》 *
徐浪: "基于Node.JS的Web应用框架研究与实现", 《中国优秀硕士学位论文数据库》 *
海拥X: "适用于JavaScript和Node.JS的JSON初学者教程", 《CSDN》 *

Also Published As

Publication number Publication date
CN114157565B (en) 2022-04-22

Similar Documents

Publication Publication Date Title
CN112306586B (en) Data processing method, device, equipment and computer storage medium
CN108011768B (en) Construction method of aop interception type HBase data storage micro-service architecture
CN112995269B (en) Data processing method, computer device and readable storage medium
CN107203388B (en) REST architecture style-oriented Web service rapid development method
CN109308224A (en) The method, apparatus and system of cross-platform data communication, cross-platform data processing
CN110995797B (en) Multilayer B/S and C/S mixed software system and asynchronous real-time communication method between layers
CN110224896B (en) Network performance data acquisition method and device and storage medium
Wu et al. OneM2M-based IoT protocol integration
CN111064626B (en) Configuration updating method, device, server and readable storage medium
CN110502212A (en) It is a kind of towards the multilingual online Development Support method of high concurrent
Mangas et al. WOTPY: A framework for web of things applications
CN110471775A (en) A method of by modeling and simulating software encapsulation at privately owned cloud service
JP2004046810A (en) Dispatch method for application step in client/server environment and service portal system
Åkesson et al. Compos: composing oblivious services
Gabbrielli et al. A language-based approach for interoperability of IoT platforms
CN114157565B (en) System and method for supporting privatized deployment
CN108600378B (en) File downloading method, device, terminal and storage medium
Wang Mobile cloud computing
CN110515599A (en) A kind of data open interface method and system based on configuration
Shah Performance analysis of mobile agents in wireless internet applications using simulation
CN102480496B (en) Method, system, service server and terminal that WAP business tine is shown
CN115562791A (en) Method for directly interacting page and bottom layer based on MDM JSON CGI interface
Falkmer et al. Compiling SDL Multiplayer Games to WebAssembly with Emscripten for use in Web Browsers
Jahed Automatic Distribution and Cloud-Native Deployment of Executable Component and Connector Model
CN117224968A (en) Object data processing method, device and storage medium

Legal Events

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